#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  for (int x = 0; x < s.length() - 1;) {
    if (s[x] == s[x + 1]) {
      s.erase(x, 2);
      if (x != 0) {
        x--;
      }
    } else {
      x++;
    }
  }
  cout << s;
  return 0;
}
