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 seed = 27;
int n, m;
long long h[50010], pw[50010];
char a[50010], b[50010];
long long calc(int l, int r) { return h[r] - h[l - 1] * pw[r - l + 1]; }
int calc_lcp(int i, int j) {
  int l, r, mid, ret = 0;
  long long s1, s2;
  l = 0;
  r = min(n - i + 1, n - j + 1);
  while (l <= r) {
    mid = (l + r) / 2;
    s1 = calc(i, i + mid - 1);
    s2 = calc(j, j + mid - 1);
    if (s1 == s2) {
      ret = max(ret, mid);
      l = mid + 1;
    } else
      r = mid - 1;
  }
  return ret;
}
int calc_lcs(int i, int j) {
  int l, r, mid, ret = 0;
  long long s1, s2;
  l = 0;
  r = min(i, j);
  while (l <= r) {
    mid = (l + r) / 2;
    s1 = calc(i - mid + 1, i);
    s2 = calc(j - mid + 1, j);
    if (s1 == s2) {
      ret = max(ret, mid);
      l = mid + 1;
    } else
      r = mid - 1;
  }
  return ret;
}
int check(int l) {
  int i, j, last = 0, s1, s2;
  for (i = 1; i <= n; i += l / 2) {
    if (last) {
      s1 = calc_lcp(last, i);
      s2 = calc_lcs(last, i);
      if (s1 + s2 - 1 >= l / 2) return 1;
    }
    last = i;
  }
  return 0;
}
int main() {
  int i, j, p, s;
  long long s1, s2;
  scanf("%s", a + 1);
  n = strlen(a + 1);
  pw[0] = 1;
  for (i = 1; i <= n; i++) pw[i] = pw[i - 1] * seed;
  for (i = 1; i <= n; i++) h[i] = h[i - 1] * seed + a[i] - 96;
  for (p = 2; p <= n; p += 2)
    if (check(p)) {
      s = 0;
      m = 0;
      for (i = 1; i <= p / 2; i++) b[++m] = a[i];
      for (i = p / 2 + 1; i <= n; i++) {
        b[++m] = a[i];
        if (b[m] == b[m - p / 2]) {
          s++;
          if (s == p / 2) {
            m -= p / 2;
            s = 0;
          }
        } else
          s = 0;
      }
      n = m;
      for (i = 1; i <= n; i++) a[i] = b[i];
      for (i = 1; i <= n; i++) h[i] = h[i - 1] * seed + (a[i] - 96);
    }
  for (i = 1; i <= n; i++) printf("%c", a[i]);
  return 0;
}