#include <bits/stdc++.h>
using namespace std;
template <typename T>
istream& operator>>(istream& in, vector<T>& v) {
  for (int i = (0); i < int(v.size()); ++i) in >> v[i];
  return in;
}
template <typename A, typename B>
istream& operator>>(istream& in, pair<A, B>& p) {
  in >> p.first >> p.second;
  return in;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T>& v) {
  if (v.size()) out << v[0];
  for (int i = (1); i < int(v.size()); ++i) out << ' ' << v[i];
  return out;
}
template <typename A, typename B>
ostream& operator<<(ostream& out, pair<A, B>& p) {
  out << p.first << ' ' << p.second;
  return out;
}
void solve() {
  string s;
  cin >> s;
  s = '?' + s + '!';
  list<char> l((s).begin(), (s).end());
  auto it = l.begin();
  while (*it != '!') {
    auto nx = it;
    nx++;
    if (*it == *nx) {
      auto rem = it;
      it--;
      l.erase(l.erase(rem));
    } else {
      it++;
    }
  }
  string s2(++l.begin(), --l.end());
  cout << s2 << endl;
}
int main() {
  cin.tie(0);
  cout.tie(0);
  cin.sync_with_stdio(false);
  solve();
}
