#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  vector<char> st;
  for (auto i : s) {
    if (st.empty() || i != st.back())
      st.push_back(i);
    else
      st.pop_back();
  }
  for (auto i : st) cout << i;
}
