#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
lli tests = 1;
int main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  for (lli test = 1; test <= tests; test++) {
    string s, ss;
    cin >> s;
    lli n = s.length();
    if (n < 3)
      cout << s;
    else {
      for (lli i = 0; i < n; i++) {
        if (i < 2)
          ss += s[i];
        else {
          if (s[i] == ss[ss.length() - 1] && s[i] == ss[ss.length() - 2])
            continue;
          else if (i > 2 && ss[ss.length() - 1] == s[i] &&
                   ss[ss.length() - 2] == ss[ss.length() - 3])
            continue;
          ss += s[i];
        }
      }
      cout << ss;
    }
  }
  return 0;
}
