#include <bits/stdc++.h>
using namespace std;
int main() {
  string in, out = "";
  cin >> in;
  int l = 0;
  for (int i = 0; i < in.size(); i++) {
    l = out.size();
    if (in[i] == in[i - 1] && in[i] == in[i - 2])
      continue;
    else if (l > 2 && in[i] == out[l - 1] && out[l - 2] == out[l - 3])
      continue;
    out += in[i];
  }
  cout << out << endl;
}
