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