capital and small letters by lifthrasiir

p=raw_input();z=['']
for c in p:z=[i+c for i in z]+[i+c.swapcase()for i in z]
z.sort();v=z.index(p);print'\n'.join(z[v:]+z[:v])

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

download

return top