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 MAX = 100000 + 10;
const int Mod = (int)1e9 + 7;
const int Mod1 = 239482903;
const int Mult = 142341;
const int Mult1 = 238478989;
int n;
char str[MAX];
long long sum[MAX];
long long sum1[MAX];
long long P[MAX], P1[MAX];
void init() {
  int i;
  for ((i) = (1); (i) <= (n); ++(i))
    sum[i] = (sum[i - 1] * Mult + str[i]) % Mod;
  for ((i) = (1); (i) <= (n); ++(i))
    sum1[i] = (sum1[i - 1] * Mult1 + str[i]) % Mod1;
}
long long getHash(int l, int r) {
  long long a = (sum[r] - sum[l - 1] * P[r - l + 1] % Mod + Mod) % Mod;
  long long b = (sum1[r] - sum1[l - 1] * P1[r - l + 1] % Mod1 + Mod1) % Mod1;
  return a * Mod + b;
}
int lcs(int a, int b) {
  if (a <= 0 || b <= 0 || a > n || b > n) return -Mod;
  if (str[a] != str[b]) return 0;
  int left = 1, right = min(n - b, n - a) + 1;
  while (left < right) {
    int mid = (left + right + 1) / 2;
    if (getHash(a, a + mid - 1) == getHash(b, b + mid - 1))
      left = mid;
    else
      right = mid - 1;
  }
  return left;
}
int check(int Len) {
  int i;
  for (i = Len + 1; i <= n; i += Len) {
    int l = lcs(i, i - Len);
    if (l >= Len) return 1;
    if (!l) continue;
    int need = Len - l;
    int can = lcs(i - need, i - Len - need);
    if (can >= need) return 1;
  }
  return 0;
}
int fa[MAX];
char nstr[MAX];
void doit(int Len) {
  int now;
  int top = 0;
  int j;
  for (now = 1; now <= n;) {
    int next = now + Len;
    if (next + Len - 1 > n ||
        getHash(next, next + Len - 1) != getHash(now, now + Len - 1)) {
      nstr[++top] = str[now];
      ++now;
      continue;
    }
    while (next + Len - 1 <= n &&
           getHash(next, next + Len - 1) == getHash(now, now + Len - 1))
      next += Len;
    nstr[++top] = str[now];
    now = next - Len + 1;
  }
  n = top;
  for ((j) = (1); (j) <= (n); ++(j)) str[j] = nstr[j];
}
int main() {
  int i;
  scanf("%s", str + 1);
  n = strlen(str + 1);
  P[0] = 1;
  P1[0] = 1;
  for ((i) = (1); (i) <= (n); ++(i)) {
    P[i] = P[i - 1] * Mult % Mod;
    P1[i] = P1[i - 1] * Mult1 % Mod1;
  }
  init();
  for ((i) = (1); (i) <= (n); ++(i))
    if (check(i)) {
      doit(i);
      init();
    }
  for ((i) = (1); (i) <= (n); ++(i)) cout << str[i];
  cout << endl;
  return 0;
}