#include <bits/stdc++.h>
using namespace std;
template <typename T>
void make_unique(vector<T> &vec) {
  sort(vec.begin(), vec.end());
  vec.erase(unique(vec.begin(), vec.end()), vec.end());
}
void __print(long long x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
bool isprime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
const long long mod = 1000000007;
const long double PI = 3.141592653589793;
const long long inf = 1e15;
const int cons = 100001;
long long N, M;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long n = 0, m = 0, i = 0, j = 0, k = 0, cnt = 0, ans = 0, sum = 0,
            flag = 0, pos = 0, ind = 0, mn = 0, mx = 0, res = 0;
  string s;
  cin >> s;
  string a;
  a += s[0];
  for (i = 1; i <= s.length() - 1; i++) {
    n = a.length();
    if (s[i] != s[i - 1]) {
      a += s[i];
      flag = 0;
    } else {
      if (a[n - 1] == a[n - 2] && a[n - 2] == s[i] && n - 2 >= 0 ||
          a[n - 2] == a[n - 3] && a[n - 1] == s[i] && n - 3 >= 0) {
        continue;
      } else {
        a += s[i];
      }
    }
  }
  cout << a;
  return 0;
}
