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