#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, s1;
  cin >> s;
  s1 = s.substr(0, 2);
  int j = 1;
  for (int i = 2; i < s.length(); i++) {
    if (j >= 1 && s[i] == s1[j] && s1[j] == s1[j - 1])
      continue;
    else if (j >= 2 && s[i] == s1[j] && s1[j - 1] == s1[j - 2])
      continue;
    else {
      j++;
      s1 += s[i];
    }
  }
  cout << s1;
}
