from itertools import permutations print("".join(list(permutations("0123456789"))[1000000-1]))