Problem: A substring of a string is a contiguous subsequence of that string. So, string bca is substring of string abcabc, but string cc is not.

A repeating block is a string formed by concatenating some string with itself. So, string abcabc is a repeating block, but strings abcabd, ababab are not.

You've got a sequence of Latin characters (string). At each step you find the shortest substring that is a repeating block, if there exists more than one you must choose the leftmost. As the substring is of form XX (X — some string) you replace this substring with X, in other words you delete one of the X substrings in the substring. You repeat this process until there remains no repeating block in the string. 

How would the final string looks like? Look at the sample explanation to understand the statement more precise.

Input

In the first line of input you're given a string of small Latin characters with length between 1 to 50000, inclusive.

Output

Print the final string after applying changes.

Examples

Input

abccabc


Output

abc


Input

aaaabaaab


Output

ab


Input

birdbirdbirdistheword


Output

birdistheword

Note

At the first sample the string transforms as follows: abccabc →  abcabc →  abc.

At the second sample the string transforms as follows: aaaabaaab →  aaabaaab →  aabaaab →  abaaab →  abaab →  abab →  ab.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long long MOD[2] = {999990991, 999990997};
char _ch[2][50050], *ch, *nx;
int N;
pair<long long, long long> operator+(pair<long long, long long> lhs,
                                     pair<long long, long long> rhs) {
  return make_pair((lhs.first + rhs.first) % MOD[0],
                   (lhs.second + rhs.second) % MOD[1]);
}
pair<long long, long long> operator-(pair<long long, long long> lhs,
                                     pair<long long, long long> rhs) {
  return make_pair((lhs.first + MOD[0] - rhs.first) % MOD[0],
                   (lhs.second + MOD[1] - rhs.second) % MOD[1]);
}
pair<long long, long long> operator*(pair<long long, long long> lhs,
                                     pair<long long, long long> rhs) {
  return make_pair((lhs.first * rhs.first) % MOD[0],
                   (lhs.second * rhs.second) % MOD[1]);
}
pair<long long, long long> pre[50050], pow26[50050];
void makeHash() {
  pre[0] = make_pair(0, 0);
  int i;
  for (i = 1; i <= N; i++)
    pre[i] = pre[i - 1] * pow26[1] + make_pair(ch[i] - 'a', ch[i] - 'a');
}
pair<long long, long long> Sub(int l, int r) {
  return pre[r] - pre[l - 1] * pow26[r - l + 1];
}
int LCP(int x, int y) {
  if (ch[x] != ch[y]) return 0;
  int L = 1, R = N - max(x, y) + 1;
  while (L < R) {
    int Mid = (L + R + 1) / 2;
    if (Sub(x, x + Mid - 1) == Sub(y, y + Mid - 1))
      L = Mid;
    else
      R = Mid - 1;
  }
  return L;
}
int LCS(int x, int y) {
  if (ch[x] != ch[y]) return 0;
  int L = 1, R = min(x, y);
  while (L < R) {
    int Mid = (L + R + 1) / 2;
    if (Sub(x - Mid + 1, x) == Sub(y - Mid + 1, y))
      L = Mid;
    else
      R = Mid - 1;
  }
  return L;
}
bool dexist(int l) {
  for (int i = l; i + l < N; i += l)
    if (LCS(i, i + l) + LCP(i + 1, i + l + 1) >= l) return true;
  for (int i = l * 2; i <= N; i += l)
    if (LCS(i, i - l) >= l) return true;
  return false;
}
int D[50050];
int Nx(int x) {
  while ((x <= N) && (D[x])) x += D[x];
  return x;
}
void process(int l) {
  int i;
  for (i = 1; i <= N; i++) D[i] = 0;
  for (i = l * 2; i <= N;)
    if (Sub(i - l * 2 + 1, i - l) == Sub(i - l + 1, i)) {
      D[i - l + 1] = l;
      i += l;
    } else
      i++;
  int nxN = 0;
  for (i = Nx(1); i <= N; i = Nx(i + 1)) nx[++nxN] = ch[i];
  swap(ch, nx);
  N = nxN;
}
int main() {
  ch = _ch[0];
  nx = _ch[1];
  scanf("%s", ch + 1);
  N = strlen(ch + 1);
  pow26[0] = make_pair(1, 1);
  pow26[1] = make_pair(26, 26);
  int i;
  for (i = 2; i <= N; i++) pow26[i] = pow26[i - 1] * pow26[1];
  makeHash();
  for (i = 1; i <= (N >> 1); i++)
    if (dexist(i)) process(i), makeHash();
  ch[N + 1] = 0;
  printf("%s", ch + 1);
}