#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int l = s.size();
  stack<char> st;
  st.push(s[0]);
  for (int i = 1; i < l; i++) {
    if (st.empty() == false && st.top() == s[i]) {
      st.pop();
    } else {
      st.push(s[i]);
    }
  }
  int lengthOFanswer = st.size();
  char answerstring[lengthOFanswer + 1];
  for (int i = lengthOFanswer - 1; i >= 0; i--) {
    answerstring[i] = st.top();
    st.pop();
  }
  answerstring[lengthOFanswer] = '\0';
  cout << answerstring << "\n";
  return 0;
}
