#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int le = s.length();
  string sis = "";
  for (int i = 0; i < le; i++) {
    if (sis.empty() || sis.back() != s[i]) {
      sis += s[i];
    } else {
      sis.pop_back();
    }
  }
  cout << sis;
  return 0;
}
