Common Permutation In Python