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