#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, t;
  cin >> s;
  int n = s.size(), j = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == s[i + 1]) s.erase(i, 2);
  }
  cout << s;
  return 0;
}
