#include <bits/stdc++.h>
using namespace std;
int main() {
  int p = 0;
  string s;
  cin >> s;
  vector<int> a(s.size(), 0);
  vector<int> b(s.size(), 0);
  for (int i = 1; i < s.size(); i++) {
    if (s[i] != s[p]) {
      b[i] = p;
      p = i;
    } else {
      a[i] = 1;
      a[p] = 1;
      p = b[p];
      if (p == 0) {
        i += 1;
        p = i;
      }
    }
  }
  string out = "";
  for (int i = 0; i < s.size(); i++) {
    if (a[i] == 0) {
      out += s[i];
    }
  }
  cout << out << endl;
  return 0;
}
