#include <bits/stdc++.h>
using namespace std;
int n, d[1000000];
string second, s1;
bool was[1000000];
int main() {
  getline(cin, second);
  second = '#' + second;
  n = second.length();
  for (int i = 1; i < n; i++) {
    if (second[i] != second[i - 1])
      d[i] = 1;
    else
      d[i] = d[i - 1] + 1;
  }
  for (int i = 1; i < n; i++)
    if (d[i] <= 2) s1 += second[i];
  second = "##" + s1;
  n = second.length();
  s1 = "";
  for (int i = 2; i < n; i++) {
    if (second[i] != second[i - 1])
      d[i] = 1;
    else
      d[i] = d[i - 1] + 1;
    if (d[i] == 2 && d[i - 2] == 2 && was[i - 2] == false)
      was[i] = true;
    else
      s1 += second[i];
  }
  cout << s1 << endl;
  return 0;
}
