#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
const int N = 2005;
set<char> vowel = {'A', 'O', 'Y', 'E', 'U', 'I', 'a', 'o', 'y', 'e', 'u', 'i'};
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
bool issquare(long long w) { return trunc(sqrt(w)) * trunc(sqrt(w)) == w; }
bool isprime(long long u) {
  for (long long i = 2; i <= (int)sqrt(u); i++) {
    if (u % i == 0) return 0;
  }
  return 1;
}
long long mod(long long to_mod) {
  to_mod %= MOD;
  while (to_mod < 0) to_mod += MOD;
  return to_mod % MOD;
}
int dx[] = {1, -1, 0, 0, 1, -1, 1, -1};
int dy[] = {0, 0, 1, -1, 1, 1, -1, -1};
long long n, m, k, a, l, r, b, t, ans = 0, res = 0, posmin, posmax, x, y, z, V,
                                  www, eee, w, e, xmax = 0, ymax = 0;
vector<long long> vv, v;
double db;
priority_queue<long long> pq;
vector<string> vs;
vector<pair<long long, long long> > vvv, sss;
map<long long, vector<long long> > adj, adj1;
char c;
bool check = true, vis[30];
map<long long, long long> maa;
map<string, long long> ma;
string ch, ch1, ch2;
stack<long long> ss;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> ch;
  cout << ch[0];
  c = ch[0];
  long long nb = 1;
  a = 0;
  bool con = true;
  for (int i = 1; i < ch.size(); i++) {
    if (ch[i] != c) {
      cout << ch[i];
      c = ch[i];
      nb = 1;
      if (a == 1)
        con = false;
      else
        con = true;
      a = 0;
      continue;
    }
    if (ch[i] == c && nb == 1 && a == 0 && con == true) {
      nb++;
      cout << ch[i];
      a = 1;
      c = ch[i];
      continue;
    }
  }
  return 0;
}
