#include <bits/stdc++.h>
using namespace std;
string input;
stack<char> check;
vector<char> vec;
int main() {
  cin >> input;
  for (int i = 0; i < (int)(input.size()); i++) {
    if (check.empty() || input[i] != check.top())
      check.push(input[i]);
    else
      check.pop();
  }
  while (!check.empty()) {
    vec.push_back(check.top());
    check.pop();
  }
  reverse(vec.begin(), vec.end());
  for (int i = 0; i < vec.size(); i++) cout << vec[i];
  cout << endl;
}
