#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
long long X1 = 277, X2 = 227;
long long M1 = 1777777777, M2 = 1444444447;
long long h1[N], h2[N];
long long p1[N], p2[N];
long long gh(int i, int j) {
  long long g1 = h1[j] - (i ? h1[i - 1] * p1[j - i + 1] : 0);
  g1 = (g1 % M1 + M1) % M1;
  long long g2 = h2[j] - (i ? h2[i - 1] * p2[j - i + 1] : 0);
  g2 = (g2 % M2 + M2) % M2;
  return g1 << 32 | g2;
}
void zf(char *s, int n, int *z) {
  for (int i = 1, j = z[0] = 0; i < n; ++i) {
    z[i] = max(0, min(z[i - j], j + z[j] - i));
    while (i + z[i] < n && s[z[i]] == s[z[i] + i]) ++z[i];
    if (j + z[j] < i + z[i]) j = i;
  }
  z[n] = 0;
}
int z1[N], z2[N];
char s1[N], s2[N];
int inf = 1e9;
int dup(char *s, int n) {
  int ans = inf;
  if (n == 2 && s[0] == s[1]) ans = 1;
  if (n < 3) return ans;
  int n1 = n >> 1;
  int n2 = n - n1;
  char *a = s, *b = s + n1;
  ans = min(ans, dup(a, n1));
  ans = min(ans, dup(b, n2));
  strncpy(s1, b, n2);
  s1[n2] = '$';
  strncpy(s1 + n2 + 1, a, n1);
  s1[n + 1] = 0;
  zf(s1, n + 1, z1);
  reverse(s1, s1 + n + 1);
  zf(s1, n + 1, z2);
  for (int i = 0; i <= n + 1; ++i)
    if (i < n1) {
      int l = z2[n1 - i];
      int r = z1[i + 1 + n2];
      if (l + r >= n1 - i) ans = min(ans, n1 - i);
    } else if (i > n1 + 1) {
      int l = z1[i - n1];
      int r = z2[n2 - (i - n1 - 1) - 1 + n1 + 1];
      if (l + r >= i - n1) ans = min(ans, i - n1);
    }
  return ans;
}
char s[N], t[N];
int main() {
  for (int i = p1[0] = 1; i < N; ++i) p1[i] = p1[i - 1] * X1 % M1;
  for (int i = p2[0] = 1; i < N; ++i) p2[i] = p2[i - 1] * X2 % M2;
  gets(s);
  int pre = 0;
  for (;;) {
    int n = strlen(s);
    for (int i = 0; i < n; ++i) h1[i] = ((i ? h1[i - 1] * X1 : 0) + s[i]) % M1;
    for (int i = 0; i < n; ++i) h2[i] = ((i ? h2[i - 1] * X2 : 0) + s[i]) % M2;
    int len = dup(s, n);
    if (len >= n) break;
    int m = 0;
    for (int i = 0; i < n; ++i) {
      t[m] = s[i];
      h1[m] = ((m ? h1[m - 1] : 0) * X1 + t[m]) % M1;
      h2[m] = ((m ? h2[m - 1] : 0) * X2 + t[m]) % M2;
      ++m;
      if (i >= len * 2 - 1) {
        long long v1 = gh(m - len, m - 1);
        long long v2 = gh(m - len * 2, m - len - 1);
        if (v1 == v2) m -= len;
      }
    }
    t[m] = 0;
    strcpy(s, t);
  }
  cout << s << endl;
  return 0;
}
