import sys input = sys.stdin.readline S = list(input())[: -1] s = [] for x in S: if len(s) and s[-1] == x: s.pop() s.append(x) print("".join(s))