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