s=input() t=[] for c in s: if len(t)>0 and t[-1]==c: t.pop() t+=[c] print("".join(t))