import sysimport itertoolsfor s in sys.stdin: s = s.strip() if s: for i in list(itertools.permutations(range(1, int(s) + 1), int(s)))[::-1]: print("".join(map(str, i)))
import sys
import itertools
for s in sys.stdin:
s = s.strip()
if s:
for i in list(itertools.permutations(range(1, int(s) + 1), int(s)))[::-1]:
print("".join(map(str, i)))
測資莫名其妙地出現了"\n"...