#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  if (s.length() == 1 || s.length() == 2) {
    cout << s << endl;
    return 0;
  }
  for (int i = 0; i < s.length() - 2; i++) {
    if (s[i + 1] == s[i]) {
      if (s[i + 2] == s[i]) {
        s.erase(i, 1);
        i--;
      } else if (s.length() - i >= 4) {
        if (s[i + 2] == s[i + 3]) {
          s.erase(i + 2, 1);
          i--;
        }
      }
    }
  }
  cout << s << endl;
}
