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 int S = 1000, MOD = 998244353;
char str[55555], tmp[55555];
int del[55555], len;
long long h[55555], p[55555];
inline bool chk(int l1, int r1, int l2, int r2) {
  if (l1 > l2) swap(l1, l2), swap(r1, r2);
  if (r2 > len) return false;
  int s1 = (h[r1] - h[l1 - 1] * p[r1 - l1 + 1] % MOD + MOD) % MOD,
      s2 = (h[r2] - h[l2 - 1] * p[r2 - l2 + 1] % MOD + MOD) % MOD;
  return s1 == s2;
}
inline int getsuf(int r1, int r2) {
  if (str[r1] != str[r2]) return 0;
  int l = 1, r = r2 - r1;
  while (l < r) {
    int mid = (l + r + 1) >> 1;
    if (chk(r1 - mid + 1, r1, r2 - mid + 1, r2))
      l = mid;
    else
      r = mid - 1;
  }
  return r1 - l + 1;
}
inline int getpre(int l1, int l2) {
  if (str[l1] != str[l2]) return 0;
  int l = 1, r = min(l2 - l1, len - l2 + 1);
  while (l < r) {
    int mid = (l + r + 1) >> 1;
    if (chk(l1, l1 + mid - 1, l2, l2 + mid - 1))
      l = mid;
    else
      r = mid - 1;
  }
  return l1 + l - 1;
}
int main() {
  scanf("%s", str + 1);
  len = strlen(str + 1);
  p[0] = 1;
  for (int i = 1; i <= len; i++) p[i] = p[i - 1] * S % MOD;
  int last = 2333333;
  for (int l = 1; l * 2 <= len; l++) {
    if (last) {
      for (int i = 1; i <= len; i++) {
        h[i] = (h[i - 1] * S + str[i]) % MOD;
      }
    }
    last = 0;
    for (int i = l + l; i <= len; i += l) {
      int ll = max(getsuf(i - l, i), last), rr = getpre(i - l, i);
      if (ll + l - 1 <= rr) {
        del[ll] = 1, last = ll + l;
      }
    }
    if (last) {
      int top = 0;
      for (int i = 1; i <= len; i++) {
        while (del[i]) {
          del[i] = 0;
          i += l;
        }
        tmp[++top] = str[i];
      }
      for (int i = 1; i <= top; i++) str[i] = tmp[i];
      len = top;
      str[len + 1] = 0;
    }
  }
  printf("%s\n", str + 1);
  return 0;
}