while 1: s=a=['/']*9 for c in input():a[s.count(c)]+=c;s=''.join(a) print(s.strip('/'))