j=''.join while 1: l=9*['/'] for i in raw_input():l[j(l).count(i)]+=i print j(l).strip('/')