#include <bits/stdc++.h>
int check(char *line);
void borrar(char *line);
int main() {
  char line[200001];
  scanf("%s", line);
  int l = strlen(line);
  while (check(line)) borrar(line);
  printf("%s", line);
  return 0;
}
int check(char *line) {
  int i, l = strlen(line);
  for (i = 0; i < l - 1; i++)
    if (line[i] == line[i + 1]) return 1;
  return 0;
}
void borrar(char *line) {
  int i, k, a, b, l = strlen(line);
  for (i = 0; i < l; i++) {
    if (line[i] == line[i + 1]) {
      a = i;
      b = i + 1;
      while (a >= 0 && b <= l) {
        if (line[a] == line[b]) {
          line[a] = '?';
          line[b] = '?';
        } else
          break;
        a--;
        b++;
      }
      i = b - 1;
    }
  }
  i = 0;
  while (line[i] != '?') i++;
  k = i;
  for (i = k; i < l; i++) {
    if (line[i] == '?')
      i++;
    else
      line[k++] = line[i];
  }
  line[k] = '\0';
}
