#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<pair<bool, char> > V;
  string st;
  cin >> st;
  int t = 1, n = st.length();
  for (int i = 1; i < n; ++i) {
    if (st[i] == st[i - 1])
      ++t;
    else {
      if (V.empty()) {
        V.push_back({t > 1, st[i - 1]});
        continue;
      }
      if (V.back().first || t == 1)
        V.push_back({0, st[i - 1]});
      else
        V.push_back({1, st[i - 1]});
      t = 1;
    }
  }
  if (V.empty())
    V.push_back({t > 1, st[n - 1]});
  else {
    if (V.back().first || t == 1)
      V.push_back({0, st[n - 1]});
    else
      V.push_back({1, st[n - 1]});
  }
  for (auto it : V) {
    putchar(it.second);
    if (it.first) putchar(it.second);
  }
  return 0;
}
