#include <bits/stdc++.h>
template <class T>
T gcd(T a, T b) {
  T r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <class T>
T sqr(T x) {
  return x * x;
}
template <class T>
T cube(T x) {
  return x * x * x;
}
using namespace std;
string s;
bool check[100005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int i, j, k, n, m, p = 0, q = 1e7;
  string s;
  char c;
  c = '0';
  cin >> s;
  for (i = 0; i < s.size(); i++) {
    if (s[i] == c) {
      if (p == 0) {
        cout << s[i];
        p = 2;
      }
    } else {
      if (p != 0) p--;
      cout << s[i];
    }
    c = s[i];
  }
  return 0;
}
