#include <bits/stdc++.h>
using namespace std;
int main() {
  string a;
  vector<char> b;
  cin >> a;
  for (int i = 0; i < a.size(); i++) {
    if (b.size() && b.back() == a[i])
      b.pop_back();
    else
      b.push_back(a[i]);
  }
  for (int i = 0; i < b.size(); i++) cout << b[i];
  return 0;
}
