#include <bits/stdc++.h>
using namespace std;
int main() {
  char a = '0', b = '1', c = '2';
  char d;
  while (cin >> d) {
    if ((d == b && d == c) || (a == b && c == d)) {
      continue;
    } else {
      cout << d;
    }
    a = b;
    b = c;
    c = d;
  }
}
