#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  int len = str.length();
  int arr[len];
  memset(arr, 0, sizeof arr);
  for (int i = 0; i < str.length(); i++) {
    if (i == 0) {
      arr[i] = 1;
      continue;
    }
    if (str[i] == str[i - 1])
      arr[i] = arr[i - 1] + 1;
    else
      arr[i] = 1;
  }
  string t = "";
  for (int i = 0; i < len; i++) {
    if (arr[i] == 1 || arr[i] == 2) t += str[i];
  }
  for (int i = 0; i < t.length(); i++) {
    if (i == 0) {
      arr[i] = 1;
      continue;
    }
    if (t[i] == t[i - 1])
      arr[i] = arr[i - 1] + 1;
    else
      arr[i] = 1;
  }
  bool flag = false;
  string ans = "";
  for (int i = 0; i < t.length(); i++) {
    if (arr[i] == 2) {
      if (flag) {
        flag = false;
      } else {
        ans += t[i];
        flag = true;
      }
    } else {
      ans += t[i];
      if (i != t.length()) {
        if (arr[i + 1] == 1) flag = false;
      }
    }
  }
  cout << ans;
}
