#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int l = s.size();
  int len = 0;
  string ans = "";
  for (int i = 0; i < l; i++) {
    len = ans.size();
    if (s[i] == s[i - 1] && s[i] == s[i - 2]) {
      continue;
    } else if (len > 2 &&
               (s[i] == ans[len - 1] && ans[len - 2] == ans[len - 3])) {
      continue;
    }
    ans += s[i];
  }
  cout << ans << "\n";
  return 0;
}
