#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  stack<char> ss;
  for (long long int i = 0; i < s.length(); i++) {
    if (ss.empty() || ss.top() != s[i]) {
      ss.push(s[i]);
    } else {
      ss.pop();
    }
  }
  vector<char> v;
  while (!ss.empty()) {
    v.push_back(ss.top());
    ss.pop();
  }
  for (long long int i = v.size() - 1; i >= 0; i--) {
    cout << v[i];
  }
  return 0;
}
