#include <bits/stdc++.h>
using namespace std;
int jk = 1e9;
long long xy1[4] = {0, 0, -1, 1};
long long xy2[4] = {1, -1, 0, 0};
long long n1, m1;
int main() {
  long long test, i, j, xy, flag = 0, n, count, u, d, o1 = 0, o2 = 0, s, e, x,
                            y, m, l, z, r, max1, x1, y1, k, x2, y2, z1, sum, f,
                            min1;
  string a;
  cin >> a;
  deque<char> mk;
  n = a.size();
  for (i = 0; i < n; i++) {
    if (mk.size() == 0 || i == 0) {
      mk.push_back(a[i]);
    } else {
      if (mk.back() != a[i]) {
        mk.pop_back();
      } else {
        mk.push_back(a[i]);
      }
    }
  }
  while (mk.size()) {
    cout << mk.front();
    mk.pop_front();
  }
  return 0;
}
