from itertools import*;s=raw_input() for i in product(*[s]*len(s)):print''.join(i)