#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long MAX = 3e6 + 10;
void solve() {
  string str;
  cin >> str;
  long long n = str.length();
  vector<char> vec;
  long long flag = 0;
  for (int i = 0; i < n; i++) {
    flag = 1;
    long long k = vec.size();
    if (k >= 2 && vec[k - 1] == vec[k - 2] && vec[k - 1] == str[i]) flag = 0;
    if (k >= 3 && vec[k - 2] == vec[k - 3] && vec[k - 1] == str[i]) flag = 0;
    if (flag) vec.push_back(str[i]);
  }
  for (int i = 0; i < vec.size(); i++) cout << vec[i];
}
int main() {
  long long t;
  t = 1;
  for (int i = 1; i < t + 1; i++) {
    solve();
  }
  return 0;
}
