#include <bits/stdc++.h>
using namespace std;
unsigned int power(unsigned int a, int b) {
  unsigned int ans = 1;
  while (b) {
    if (b & 1) ans = ans * a;
    a *= a;
    b >>= 1;
  }
  return ans;
}
const int NN = 50505;
const unsigned int H = 513;
char s[NN];
unsigned int asdf[NN];
unsigned int po[NN];
unsigned int rpo[NN];
int n;
void make() {
  asdf[0] = s[0] - 'a' + 1;
  for (int i = 1; i < n; i++) {
    asdf[i] = asdf[i - 1] + (s[i] - 'a' + 1) * po[i];
  }
}
unsigned int calc(int L, int R) {
  if (!L)
    return asdf[R] * po[NN - 1 - L];
  else {
    return (asdf[R] - asdf[L - 1]) * po[NN - 1 - L];
  }
}
void solve(int len) {
  for (int i = 0, j; i + len + len <= n;) {
    if (calc(i, i + len - 1) == calc(i + len, i + len + len - 1)) {
      for (j = i; j < i + len; j++) s[j] = 0;
      i += len;
    } else
      i++;
  }
  int m = 0;
  for (int i = 0; i < n; i++) {
    if (s[i]) {
      s[m++] = s[i];
    }
  }
  n = m;
  s[n] = 0;
  make();
}
bool check(int len) {
  for (int i = 0, j = len, st, ed, md, k; j < n; i += len, j += len) {
    if (s[i] != s[j]) continue;
    st = 1;
    ed = min(len, n - j) + 1;
    while (ed > st + 1) {
      md = st + ed >> 1;
      if (calc(i, i + md - 1) == calc(j, j + md - 1))
        st = md;
      else
        ed = md;
    }
    k = st;
    st = 0;
    ed = min(len, i) + 1;
    while (ed > st + 1) {
      md = st + ed >> 1;
      if (calc(i - md, i - 1) == calc(j - md, j - 1))
        st = md;
      else
        ed = md;
    }
    k += st;
    if (k >= len) return 1;
  }
  return 0;
}
int main() {
  for (int i = po[0] = 1; i < NN; i++) {
    po[i] = po[i - 1] * H;
  }
  scanf("%s", s);
  n = strlen(s);
  n = unique(s, s + n) - s;
  s[n] = 0;
  make();
  for (int i = 2; i + i <= n; i++) {
    if (check(i)) solve(i);
  }
  printf("%s\n", s);
  return 0;
}
