#include <bits/stdc++.h>
typedef struct _stack {
  char array[200005];
  int pos;
} Stack, *PStack;
void init(PStack stack) { stack->pos = -1; }
void purge(PStack stack) { stack->pos = -1; }
void put(PStack stack, char sym) {
  stack->pos++;
  stack->array[stack->pos] = sym;
}
char out(PStack stack) {
  stack->pos--;
  if (stack->pos >= 0)
    return stack->array[stack->pos];
  else
    return 0;
}
char isIn(PStack stack, char sym) {
  int i;
  char result = 0;
  for (i = stack->pos; i >= 0; --i) {
    if (stack->array[i] == sym) {
      result = 1;
    }
  }
  return result;
}
int main() {
  Stack stack;
  char first;
  char peek;
  int c, i;
  init(&stack);
  while ((c = getchar()) != EOF && c != '\n') {
    if (c == peek) {
      peek = out(&stack);
    } else {
      put(&stack, c);
      peek = c;
    }
  }
  for (i = 0; i <= stack.pos; ++i) {
    putchar(stack.array[i]);
  }
  putchar('\n');
  return 0;
}
