#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  string t = "";
  t += s[0];
  if (s.length() > 1) t += s[1];
  for (int i = 2; i < s.length(); i++) {
    int l = t.length();
    if (l > 2 && s[i] == t[l - 1] && t[l - 2] == t[l - 3]) continue;
    if (s[i] == t[l - 1] && s[i] == t[l - 2]) continue;
    t += s[i];
  }
  cout << t;
}
