#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long int a[200005], k = 0;
  a[0] = 0;
  char ch = s[0];
  k++;
  for (int i = 1; i < s.length(); i++) {
    if (ch == s[i]) continue;
    a[k++] = i;
    ch = s[i];
  }
  a[k] = s.length();
  int c = 0, curr = 0;
  for (int i = 0; i < k; i++) {
    cout << s[a[i]];
    if (c < 2 && (a[i + 1] - a[i]) > 1) {
      cout << s[a[i]];
      c = 2;
    } else
      c = 1;
  }
  return 0;
}
