#include <bits/stdc++.h>
using namespace std;
string s, ans;
vector<int> vc;
int main() {
  cin >> s;
  vc.push_back(1);
  ans.push_back(s[0]);
  for (int i = 1; i < s.size(); i++) {
    if (s[i] == s[i - 1])
      vc.back()++;
    else {
      vc.push_back(1);
      ans.push_back(s[i]);
    }
  }
  for (int i = 0; i < vc.size(); i++) {
    if (vc[i] > 2) vc[i] = 2;
    if (i && vc[i - 1] == 2) vc[i] = 1;
  }
  for (int i = 0; i < vc.size(); i++)
    for (int j = 0; j < vc[i]; j++) cout << ans[i];
  cout << endl;
}
