#include <bits/stdc++.h>
int main() {
  char c, a[1000004];
  int x = 0, i = 0;
  while ((c = getchar()) != '\n') {
    if (i <= 0 || a[i - 1] != c) {
      a[i++] = c;
    } else
      i--;
  }
  a[i] = '\0';
  printf("%s", a);
  return 0;
}
