#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, d = "";
  stack<char> list;
  cin >> s;
  for (int x = 0; x < s.length(); x++) {
    if (list.size() > 0) {
      if (s[x] != list.top()) {
        list.push(s[x]);
      } else {
        list.pop();
      }
    } else
      list.push(s[x]);
  }
  while (!list.empty()) {
    d += list.top();
    list.pop();
  }
  reverse(d.begin(), d.end());
  cout << d << endl;
}
