#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  char c[200001];
  c[0] = s[0];
  int w = 0;
  for (int i = 1; i < s.length(); i++) {
    if (w >= 0 && c[w] != s[i]) {
      c[++w] = s[i];
    } else {
      if (w < 0) {
        w = 0;
        c[0] = s[i];
      } else
        w--;
    }
  }
  for (int i = 0; i <= w; i++) cout << c[i];
  return 0;
}
