character subsets by Defenestrator

s=n='\n'
for c in raw_input()[::-1]:s+=s.replace(n,n+c)*-~-(c in s)
print s[1:]

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

download

return top