#include <bits/stdc++.h>
using namespace std;
const int inv = 1000000000;
const int minv = -inv;
const int max_n = 200010;
int n;
char s[max_n + 5];
int dp[max_n + 1][3][27];
pair<int, int> rd[max_n + 1][3][27];
int res = -1;
pair<int, pair<int, int> > sol;
void go(int ni, int nt, int nlast, int pi, int pt, int plast) {
  if (dp[ni][nt][nlast] < dp[pi][pt][plast] + 1) {
    dp[ni][nt][nlast] = dp[pi][pt][plast] + 1;
    rd[ni][nt][nlast] = pair<int, int>(pt, plast);
  }
  if (dp[ni][nt][nlast] > res) {
    res = dp[ni][nt][nlast];
    sol = pair<int, pair<int, int> >(ni, pair<int, int>(nt, nlast));
  }
}
void trace(pair<int, pair<int, int> > csol) {
  if (csol.first == n) return;
  pair<int, pair<int, int> > nsol = pair<int, pair<int, int> >(
      csol.first + 1, rd[csol.first][csol.second.first][csol.second.second]);
  if (dp[csol.first][csol.second.first][csol.second.second] !=
      dp[nsol.first][nsol.second.first][nsol.second.second])
    printf("%c", s[csol.first]);
  trace(nsol);
}
int main() {
  scanf("%s", s);
  for (n = 0; s[n] != '\0'; ++n)
    ;
  for (int i = 0; i <= n; ++i)
    for (int t = 0; t < 3; ++t)
      for (int last = 0; last < 27; ++last) dp[i][t][last] = -1;
  dp[n][0][26] = 0;
  for (int i = n; i > 0; --i) {
    for (int t = 0; t < 3; ++t)
      for (int last = 0; last < 27; ++last)
        if (dp[i][t][last] >= 0) {
          if (dp[i][t][last] > dp[i - 1][t][last]) {
            dp[i - 1][t][last] = dp[i][t][last];
            rd[i - 1][t][last] = pair<int, int>(t, last);
          }
          if (t == 0) {
            if ((int(s[i - 1] - 'a')) == last)
              go(i - 1, 2, (int(s[i - 1] - 'a')), i, t, last);
            else
              go(i - 1, 0, (int(s[i - 1] - 'a')), i, t, last);
          } else if (t == 1) {
            if ((int(s[i - 1] - 'a')) != last)
              go(i - 1, 0, (int(s[i - 1] - 'a')), i, t, last);
          } else {
            if ((int(s[i - 1] - 'a')) != last)
              go(i - 1, 1, (int(s[i - 1] - 'a')), i, t, last);
          }
        }
  }
  trace(sol);
  printf("\n");
  return 0;
}
