s=input() b=[] if len(s)==1: print(s) for i in range(len(s)-1): if s[i]!=s[i+1]: b.append(s[i]) if s[-1]!=s[-2]: b.append(s[-1]) print(''.join(b))