while 1: t="" for i in raw_input():t+=-~-(i in t)*i print t