#include <bits/stdc++.h>
using namespace std;
char c[300000];
char d[300000];
int m;
int main() {
  gets(c);
  int n = strlen(c);
  int i;
  m = 0;
  for (i = 0; i < n; i++) {
    if (m == 0 || d[m - 1] != c[i])
      d[m++] = c[i];
    else
      m--;
  }
  for (i = 0; i < m; i++) printf("%c", d[i]);
  printf("\n");
  return 0;
}
