#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long t = 1;
  while (t--) {
    string s;
    cin >> s;
    long long n = s.size();
    string ans = "";
    long long j = 0;
    for (long long i = 0; i < n; i++) {
      if (i >= 2 and s[i] == ans[j - 1] and ans[j - 1] == ans[j - 2]) continue;
      if (i >= 3 and s[i] == ans[j - 1] and ans[j - 2] == ans[j - 3])
        continue;
      else {
        ans += s[i];
        j++;
      }
    }
    cout << ans;
  }
  return 0;
}
