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