s=input() v=sorted(set(s)) for a in v:print(''.join(' #'[(b,a)in zip(*[iter(s)]*2)]for b in v).rstrip())