integer concatenation by davisagli

from itertools import*
input()
exec'print max(int("".join(l))-int("".join(l)[::-1]) for l in permutations(raw_input().split()));'*6

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return top