while 1: s='' for c in raw_input():s+=c[c in s:] print s