#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int j = 0;
  vector<char> v;
  bool ok;
  for (int i = 0; i < s.size(); i++) {
    ok = false;
    while (j != 0 && s[i] == v[j - 1]) {
      ok = true;
      j--;
      v.pop_back();
      j = max(j, 0);
    }
    if (!ok) {
      j++;
      v.push_back(s[i]);
    }
  }
  for (int i = 0; i < j; i++) {
    cout << v[i];
  }
  return 0;
}
