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