#include <bits/stdc++.h>
using namespace std;
int main() {
  char inp[200001], out[200001];
  cin.getline(inp, 200001, '\n');
  int ln = strlen(inp);
  inp[ln++] = 'A';
  out[0] = inp[0];
  int end = 1;
  for (int i = 1; i < ln; i++) {
    if (out[end - 1] == inp[i]) {
      out[end--] = '\0';
    } else {
      out[end++] = inp[i];
    }
  }
  out[strlen(out) - 1] = '\0';
  cout << out << endl;
  return 0;
}
