#include <bits/stdc++.h>
int main() {
  std::ios::sync_with_stdio(0);
  std::cin.tie(0);
  std::string st;
  std::cin >> st;
  int tp = 1, rs = 0;
  char c = st[0];
  std::vector<int> v;
  std::vector<char> vc;
  for (int i = 1; i < st.size(); ++i) {
    if (st[i] == st[i - 1]) {
      ++tp;
    } else
      v.push_back(tp), tp = 1, vc.push_back(c), c = st[i];
  }
  v.push_back(tp);
  vc.push_back(c);
  for (int& x : v) x = std::min(2, x);
  for (int i = 1; i < v.size(); ++i)
    if (v[i] > 1 && v[i - 1] > 1) v[i] = 1;
  for (int i = 0; i < v.size(); ++i) {
    for (int j = 0; j < v[i]; ++j) std::cout << vc[i];
  }
}
