#include <bits/stdc++.h>
using namespace std;
void magic();
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) magic();
  return 0;
}
void magic() {
  string str;
  cin >> str;
  long long int n = str.length();
  string res = str.substr(0, 1);
  if (n > 1) res += str[1];
  for (int i = 2; i < n; i++) {
    long long int sz = res.size();
    if (str[i] != res[sz - 1]) {
      res += str[i];
    } else {
      if (str[i] != res[sz - 2] && (sz < 3 || res[sz - 2] != res[sz - 3]))
        res += str[i];
    }
  }
  cout << res << "\n";
}
