#include <bits/stdc++.h>
using namespace std;
string s;
void solve() {
  int n = s.size(), ts;
  string t = "";
  t = t + s[0];
  if (n != 1) {
    t.push_back(s[1]);
    ts = 2;
    if (n != 2) {
      if ((s[2] == t[ts - 1] && s[2] != t[ts - 2]) || s[2] != t[ts - 1]) {
        t.push_back(s[2]);
        ts++;
      }
      for (int i = 3; i < n; i++) {
        if ((s[i] == t[ts - 1] && s[i] != t[ts - 2] &&
             t[ts - 2] != t[ts - 3]) ||
            s[i] != t[ts - 1]) {
          t.push_back(s[i]);
          ts++;
        }
      }
    }
  }
  cout << t << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> s;
  solve();
  return 0;
}
