#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 10;
int main() {
  char k1 = 1, k2 = 2, k3 = 3, ch;
  while (cin >> ch) {
    if (!((k2 == k3 && k3 == ch) || (k1 == k2 && k3 == ch))) {
      putchar(ch);
      k1 = k2;
      k2 = k3;
      k3 = ch;
    }
  }
  return 0;
}
