#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[200005], c;
  int i = 0;
  c = '0';
  while (c != '\n') {
    c = getchar();
    if ((i > 1 && a[i - 1] == a[i - 2] && a[i - 1] == c) ||
        (i > 2 && a[i - 1] == c && a[i - 2] == a[i - 3]) || c == '\n') {
      continue;
    }
    a[i++] = c;
  }
  a[i] = '\0';
  cout << a << endl;
  return 0;
}
