#include <bits/stdc++.h>
using namespace std;
string word;
stack<char> f;
void print() {
  if (f.empty()) return;
  char ch = f.top();
  f.pop();
  print();
  cout << ch;
}
int main() {
  cin >> word;
  for (int i = 0; i < word.length(); i++) {
    if (f.empty()) {
      f.push(word[i]);
    } else {
      if (word[i] == f.top())
        f.pop();
      else
        f.push(word[i]);
    }
  }
  print();
  cout << endl;
  return 0;
}
