#include <bits/stdc++.h>
int main() {
  std::string s;
  std::list<char> st;
  std::cin >> s;
  for (size_t i = 0; i < s.size(); ++i) {
    if (st.empty() || st.back() != s[i])
      st.push_back(s[i]);
    else
      st.pop_back();
  }
  for (std::list<char>::iterator i = st.begin(); i != st.end(); ++i)
    std::cout << *i;
  return 0;
}
