#include <bits/stdc++.h>
using namespace std;
const int N = (int)2e5 + 1;
const long long INF = 1e9 + 7;
string s;
int main() {
  cin >> s;
  vector<char> v;
  for (int i = 0; i < s.size(); ++i) {
    if (v.size() > 0 && v.back() == s[i]) {
      v.pop_back();
    } else {
      v.push_back(s[i]);
    }
  }
  for (char i : v) {
    cout << i;
  }
  return 0;
}
