#include <bits/stdc++.h>
using namespace std;
string st, st1, st2;
int main() {
  long long i, j, k, a, b, n, m, len;
  cin >> st;
  len = st.length();
  j = 0;
  for (i = 0; i < len; ++i) {
    if (i < 2) {
      st1.push_back(st[i]);
    } else if (!(st[i] == st[i - 1] && st[i] == st[i - 2])) {
      st1.push_back(st[i]);
    }
  }
  j = st1.length();
  k = 0;
  for (i = 0; i < j; ++i) {
    if (i < 3) {
      st2.push_back(st1[i]);
      ++k;
    } else if (!(st1[i] == st2[k - 1] && st2[k - 2] == st2[k - 3])) {
      st2.push_back(st1[i]);
      ++k;
    }
  }
  cout << st2 << endl;
  return 0;
}
