#include <bits/stdc++.h>
using namespace std;
int l;
char a[200010], b[200010];
int main() {
  scanf("%s", a);
  l = 0;
  for (int i = 0; a[i]; i++)
    if (l == 0 || a[i] != b[l - 1])
      b[l++] = a[i];
    else
      l--;
  b[l++] = 0;
  puts(b);
  return 0;
}
