#include <bits/stdc++.h>
using namespace std;
int ls, cc;
char s[1111111], a[1111111];
int main() {
  gets(s), ls = strlen(s), cc = 0, a[0] = '#';
  for (int i = 0; i < ls; ++i) {
    a[++cc] = s[i];
    while (cc > 1 && a[cc - 1] != a[cc]) cc -= 2;
  }
  for (int i = 1; i <= cc; ++i) putchar(a[i]);
  return 0;
}
