#include <bits/stdc++.h>
int main() {
  char c;
  char *ptr = (char *)malloc(sizeof(char) * 200001);
  int i = 0;
  while ((c = getchar()) != '\n') {
    *(ptr + i) = c;
    if (*(ptr + i) == *(ptr + i - 1)) {
      *(ptr + i) = '\0';
      *(ptr + i - 1) = '\0';
      i = i - 1;
    } else {
      i++;
    }
  }
  *(ptr + i) = '\0';
  puts(ptr);
}
