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