#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200010;
char s[MAXN], v[MAXN];
int N, vf;
int main() {
  int i;
  cin.getline(v, MAXN);
  N = strlen(v);
  for (i = 0; i < N; ++i) {
    if (vf != 0 && v[i] == s[vf])
      vf--;
    else
      s[++vf] = v[i];
  }
  for (i = 1; i <= vf; ++i) cout << s[i];
  return 0;
}
