#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  char s1[200001];
  int pos = 0;
  s1[pos++] = s[0];
  for (int i = 1; i < s.size(); ++i) {
    if (pos == 0 || s1[pos - 1] != s[i])
      s1[pos++] = s[i];
    else
      --pos;
  }
  for (int i = 0; i < pos; ++i) cout << s1[i];
  cout << endl;
  return 0;
}
