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