#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  vector<char> v;
  for (int i = 0; i < s.length(); i++) {
    if (v.empty()) {
      v.push_back(s[i]);
    } else {
      if (s[i] == v.back()) {
        v.pop_back();
      } else {
        v.push_back(s[i]);
      }
    }
  }
  for (int i = 0; i < v.size(); i++) {
    cout << v[i];
  }
  return 0;
}
