import sys
s=input()
if s == s[::-1] and len(s)%2==0:
    print(0)
else:
    i = 0
    while i<len(s)-1:
        if s[i]==s[i+1]:
            s=s.replace(s[i:i+2],"")
        #因为最后都要+1,为了保证非首位要回退1个(-2+1),首位不回退,(-1+1)
            if i>0:
                i-=2
            else:
                i-=1
        i+=1
    print(s)