#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  string s;
  cin >> s;
  deque<char> stc;
  for (int i = 0; i < s.size(); i++) {
    if (stc.empty()) {
      stc.push_back(s[i]);
    } else {
      if (stc.back() == s[i]) {
        stc.pop_back();
      } else {
        stc.push_back(s[i]);
      }
    }
  }
  while (!stc.empty()) {
    cout << stc.front();
    stc.pop_front();
  }
}
