#include <bits/stdc++.h>
using namespace std;
int main() {
  string str, tmp;
  cin >> str;
  tmp.push_back(str[0]);
  for (int i = 1; i < str.size(); i++) {
    if (tmp.back() == str[i])
      tmp.pop_back();
    else
      tmp.push_back(str[i]);
  }
  cout << tmp;
  return 0;
}
