#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2 = "";
  cin >> s1;
  for (int i = 0; i < s1.size(); i++) {
    if (s2.back() != s1[i]) {
      s2 += s1[i];
    } else {
      s2.pop_back();
    }
  }
  cout << s2 << endl;
  return 0;
}
