#include <bits/stdc++.h>
using namespace std;
string S;
int s;
int num[50005], tmp[50005];
long long hsh[50005], hsh2[50005];
long long power[50005], power2[50005];
vector<pair<int, int> > op;
void recalculate(int s) {
  for (int j = (0); j <= (s - 1); j += (1)) {
    if (j == 0) {
      hsh[j] = hsh2[j] = S[num[j]] - 'a';
    } else {
      hsh[j] = (hsh[j - 1] * 99991 + S[num[j]] - 'a') % 805306457;
      hsh2[j] = (hsh2[j - 1] * 99991 + S[num[j]] - 'a') % 1610612741;
    }
  }
}
bool cmp(int i, int j, int d) {
  d = (1 << d);
  long long vi =
      (hsh[i + d - 1] - hsh[i - 1] * power[d] % 805306457 + 805306457) %
      805306457;
  long long vi2 =
      (hsh2[i + d - 1] - hsh2[i - 1] * power2[d] % 1610612741 + 1610612741) %
      1610612741;
  long long vj =
      (hsh[j + d - 1] - hsh[j - 1] * power[d] % 805306457 + 805306457) %
      805306457;
  long long vj2 =
      (hsh2[j + d - 1] - hsh2[j - 1] * power2[d] % 1610612741 + 1610612741) %
      1610612741;
  return (vi == vj && vi2 == vj2);
}
int findlcp(int i, int j) {
  if (i < 0 || j >= s) return 0;
  int ans = 0;
  for (int k = (15); k >= (0); k -= (1)) {
    if (j + (1 << k) > s) continue;
    if (cmp(i, j, k)) {
      i += (1 << k);
      j += (1 << k);
      ans += (1 << k);
    }
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> S;
  s = S.length();
  for (int i = (0); i <= (s - 1); i += (1)) {
    num[i] = i;
    if (i == 0)
      power[i] = power2[i] = 1;
    else {
      power[i] = power[i - 1] * 99991 % 805306457;
      power2[i] = power2[i - 1] * 99991 % 1610612741;
    }
  }
  recalculate(s);
  for (int i = (1); i <= (s / 2); i += (1)) {
    op.clear();
    for (int j = (i); j <= (s - 1); j += (i)) {
      int pj = j - i;
      int lcp = findlcp(pj, j);
      int minus = (i - lcp % i) % i;
      int lcp2 = findlcp(pj - minus, j - minus);
      if (lcp2 >= i) {
        op.push_back({pj - minus, -1});
        op.push_back({j - minus, 1});
      }
    }
    if (op.empty()) continue;
    int ops = op.size();
    int d = 0, pd = 0, cnt = 0, it = -1;
    for (int j = (0); j <= (ops - 1); j += (1)) {
      pair<int, int> a = op[j];
      while (j < ops - 1 && a.first == op[j + 1].first)
        a.second += op[++j].second;
      d += a.second;
      if (pd == 0)
        while (cnt < a.first) tmp[++it] = num[cnt], cnt++;
      if (d == 0) cnt = a.first;
      pd = d;
    }
    if (pd == 0)
      while (cnt <= s - 1) tmp[++it] = num[cnt], cnt++;
    s = it + 1;
    for (int j = (0); j <= (s - 1); j += (1)) num[j] = tmp[j];
    recalculate(s);
  }
  for (int i = (0); i <= (s - 1); i += (1)) {
    printf("%c", S[num[i]]);
  }
  printf("\n");
  return 0;
}
