#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
int main() {
  string a;
  cin >> a;
  long long sum = 0;
  vector<pair<char, int> > v;
  int n = a.length();
  char last = a[0];
  int cnt = 1;
  for (long long i = 1; i < n; i++) {
    if (a[i] != last) {
      sum += max(cnt - 2, 0);
      v.push_back(make_pair(last, min(2, cnt)));
      cnt = 1;
      last = a[i];
    } else
      cnt++;
  }
  sum += max(cnt - 2, 0);
  v.push_back(make_pair(last, min(2, cnt)));
  int m = v.size();
  for (long long i = 1; i < m; i++) {
    if (v[i].second == 2 && v[i - 1].second == 2) {
      v[i].second--;
      sum++;
    }
  }
  for (long long i = 0; i < m; i++) {
    for (long long j = 0; j < v[i].second; j++) {
      cout << v[i].first;
    }
  }
}
