#include <bits/stdc++.h>
char stack[500000];
int top;
int main() {
  char ch;
  int i;
  top = 0;
  while (true) {
    scanf("%c", &ch);
    if (ch == '\n') break;
    if (top == 0)
      stack[top++] = ch;
    else {
      if (ch == stack[top - 1])
        top--;
      else
        stack[top++] = ch;
    }
  }
  for (i = 0; i < top; i++) putchar(stack[i]);
  putchar('\n');
  return 0;
}
