#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  vector<pair<char, int> > v;
  for (long long int i = 0; i < s.size();) {
    char pre = s[i];
    long long int temp = i;
    while (i < s.size() && s[i] == pre) i++;
    v.push_back({pre, i - temp});
  }
  for (long long int i = 0; i < v.size(); i++) {
    if (v[i].second == 1) continue;
    long long int temp = i + 1;
    while (temp < v.size() && v[temp].second >= 2) v[temp].second = 1;
    i = temp - 1;
  }
  for (long long int i = 0; i < v.size(); i++) {
    if (v[i].second == 1)
      cout << v[i].first;
    else
      cout << v[i].first << v[i].first;
  }
  return 0;
}
