#include <bits/stdc++.h>
using namespace std;
char s[200005];
char x[200006];
int main() {
  while (scanf("%s", s) != EOF) {
    int len = strlen(s);
    int top = 0;
    for (int i = 0; i < len; i++) {
      if (top == 0)
        x[top++] = s[i];
      else if (x[top - 1] == s[i])
        top--;
      else
        x[top++] = s[i];
    }
    for (int i = 0; i < top; i++) printf("%c", x[i]);
    puts("");
  }
  return 0;
}
