#include <bits/stdc++.h>
char ch[222222], stack[222222];
int main() {
  scanf("%s", ch);
  int tail = 0, len = strlen(ch);
  for (int i = 0; i < len; i++) {
    if (tail > 0 && ch[i] == stack[tail - 1])
      tail--;
    else
      stack[tail++] = ch[i];
  }
  for (int i = 0; i < tail; i++) printf("%c", stack[i]);
  puts("");
  return 0;
}
