#include <bits/stdc++.h>
using namespace std;
const double pi = 4.0 * atan(1.0);
template <typename T>
inline string toString(const T &a) {
  ostringstream s;
  s << a;
  return s.str();
}
template <typename T>
inline void print(const vector<T> &a, const string &delim) {
  for (typename vector<T>::const_iterator it = a.begin(); it != a.end(); ++it) {
    cout << *it << delim;
  }
  if (delim != "\n") cout << endl;
}
template <typename T>
inline void print(const vector<vector<T> > &a) {
  for (int i = (0); i < ((int)a.size()); ++(i)) {
    for (int j = (0); j < ((int)a[i].size()); ++(j)) {
      cout << a[i][j] << " ";
    }
    cout << endl;
  }
}
inline void print(int *a, const string &delim) {
  for (int i = (0); i < (sizeof(a)); ++(i)) {
    cout << a[i] << delim;
  }
  if (delim != "\n") cout << endl;
}
inline int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
inline int lcm(int a, int b) { return (a * (b / gcd(a, b))); }
inline vector<string> tokenize(const string &s, const string &delim) {
  vector<string> tokens;
  string::size_type pos = 0, cur = pos;
  while ((pos = s.find(delim, cur)) != string::npos) {
    tokens.push_back(s.substr(cur, pos - cur));
    cur = pos + delim.length();
  }
  if (cur <= (int)s.size() - 1)
    tokens.push_back(s.substr(cur, (int)s.size() - cur));
  return tokens;
}
string sub3(const string &s) {
  string res = "";
  int start = 0;
  while (start < (int)s.size()) {
    int inc = 0;
    char cur = s[start];
    while (start + inc < (int)s.size() && s[start + inc] == cur) {
      inc++;
    }
    int times = min(2, inc);
    for (int i = (0); i < (times); ++(i)) res += cur;
    start += inc;
  }
  return res;
}
bool ismiddle(int i, const string &s) {
  if (i <= 1 || i >= (int)s.size() - 3) return false;
  return ((s[i - 2] == s[i - 1]) && s[i] == s[i + 1] && (s[+2] == s[+3]));
}
bool isafter(int i, const string &s) {
  if (i <= 1) return false;
  return s[i - 1] == s[i - 2] && s[i] == s[i + 1];
}
string sub2(string &s) {
  string res = "";
  for (int i = (0); i < ((int)s.size() - 1); ++(i)) {
    if (ismiddle(i, s)) {
      s[i] = '*';
      i += 2;
      continue;
    }
    if (isafter(i, s)) {
      s[i] = '*';
      s += 2;
      continue;
    }
  }
  for (int i = (0); i < ((int)s.size()); ++(i))
    if (s[i] >= 'a' && s[i] <= 'z') res += s[i];
  return res;
}
int main() {
  string s;
  cin >> s;
  s = sub3(s);
  s = sub2(s);
  cout << s << endl;
  return 0;
}
