#include <bits/stdc++.h>
char s[200010], str[200010];
int main() {
  scanf("%s", s);
  int i, j = -1;
  for (i = 0; s[i]; ++i)
    if (j == -1)
      str[++j] = s[i];
    else if (str[j] == s[i])
      --j;
    else
      str[++j] = s[i];
  str[++j] = '\0';
  printf("%s\n", str);
  return 0;
}
