#include <bits/stdc++.h>
using namespace std;
const long long int N = 2e5 + 5;
const long long int INF = 1e18;
const long long int mod = 1e9 + 7;
const double PI = 3.14159265358979323846;
template <typename T>
T power(T x, T y, long long int m = mod) {
  T ans = 1;
  while (y > 0) {
    if (y & 1LL) ans = (ans * x) % m;
    y >>= 1LL;
    x = (x * x) % m;
  }
  return ans % m;
}
long long int n;
string second;
long long int mark[N];
vector<long long int> v, v2;
vector<char> c;
int main() {
  cin >> second;
  long long int n = second.length();
  for (long long int i = 0; i < n; i++) {
    long long int j = i, cnt = 0;
    if (mark[i]) {
      continue;
    }
    while (j < n && second[i] == second[j]) {
      cnt++;
      mark[j] = 1;
      j++;
    }
    v.push_back(cnt);
    v2.push_back(cnt);
    c.push_back(second[i]);
  }
  for (long long int i = 0; i < v.size() - 1; i++) {
    if (v[i] == 1) {
      continue;
    }
    if (v[i] == 2) {
      if (v[i + 1] == 1) {
        continue;
      }
      v[i + 1] = 1;
    } else {
      if (v[i + 1] == 1) {
        v[i] = 2;
      } else {
        v[i] = 1;
      }
    }
  }
  string second = "\0", q = "\0";
  if (v[v.size() - 1] > 2) {
    v[v.size() - 1] = 2;
  }
  for (long long int i = 0; i < v.size(); i++) {
    long long int cnt = v[i];
    while (cnt--) {
      second += c[i];
    }
  }
  if (v2[0] > 2) {
    v2[0] = 2;
  }
  for (long long int i = 1; i < v2.size(); i++) {
    if (v2[i] == 1) {
      continue;
    }
    if (v2[i] == 2) {
      if (v2[i - 1] == 1) {
        continue;
      }
      v2[i] = 1;
    } else {
      if (v2[i - 1] == 1) {
        v2[i] = 2;
      } else {
        v2[i] = 1;
      }
    }
  }
  for (long long int i = 0; i < v2.size(); i++) {
    long long int cnt = v2[i];
    while (cnt--) {
      q += c[i];
    }
  }
  if (second.length() > q.length()) {
    cout << second << endl;
    exit(0);
  }
  cout << q << endl;
}
