#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m = 0, i, j = 0, l = 0, k, p = 0, y = 1e18, z, r, t = 0;
  string s;
  cin >> s;
  n = s.length();
  for (i = n - 2; i >= 0; i--) {
    if (s[i] == s[i + 1]) {
      s.erase(i, 2);
    }
  }
  cout << s;
  return 0;
}
