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