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