#include <bits/stdc++.h>
using namespace std;
char str[200001];
char ret[200001];
int main() {
  scanf("%s", str);
  string s(str);
  int count = 0;
  for (int i = 0; i < s.length(); i++) {
    if (str[i] == ret[count - 1])
      ret[--count] = '\0';
    else
      ret[count++] = str[i];
  }
  printf("%s\n", ret);
  return 0;
}
