#include <bits/stdc++.h>
using namespace std;
int main() {
  char m[200010];
  string s;
  int n = 0;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (m[n - 1] == s[i])
      n--;
    else if (n == 0 or m[n - 1] != s[i])
      m[n++] = s[i];
  }
  for (int i = 0; i < n; i++) cout << m[i];
}
