#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000 * 1000 * 1000 + 7;
const int INF = 2000 * 1000 * 1000;
const double EPS = 1e-9;
const double pi = acos(-1.0);
template <typename T>
inline T sqr(T n) {
  return (n * n);
}
int main() {
  string s;
  getline(cin, s);
  vector<pair<char, int> > a;
  for (size_t i = 0; i < s.size(); i++) {
    if (a.empty() || a.back().first != s[i])
      a.push_back(make_pair(s[i], 1));
    else
      a.back().second++;
  }
  int n = a.size();
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (a[i].second > 2) {
      ans += a[i].second - 2;
      a[i].second = 2;
    }
  }
  for (int i = 0; i < n - 1; i++) {
    if (a[i].second == 2 && a[i + 1].second == 2) {
      ans++;
      a[i + 1].second = 1;
    }
  }
  for (int i = 0; i < n; i++) {
    while (a[i].second--) cout << a[i].first;
  }
  return 0;
}
