#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  char *newStr = new char[str.size()];
  int length = 0;
  for (string::iterator i = str.begin(); i != str.end(); ++i) {
    if (length != 0 && newStr[length - 1] == *i)
      --length;
    else
      newStr[length++] = *i;
  }
  for (int i = 0; i < length; ++i) cout << newStr[i];
  return 0;
}
