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