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;
unsigned int power(unsigned int a, int b) {
  unsigned int ans = 1;
  while (b) {
    if (b & 1) ans = ans * a;
    a *= a;
    b >>= 1;
  }
  return ans;
}
const int NN = 50505;
const unsigned int H = 513;
char s[NN];
unsigned int asdf[NN];
unsigned int po[NN];
unsigned int rpo[NN];
int n;
void make() {
  asdf[0] = s[0] - 'a' + 1;
  for (int i = 1; i < n; i++) {
    asdf[i] = asdf[i - 1] + (s[i] - 'a' + 1) * po[i];
  }
}
unsigned int calc(int L, int R) {
  if (!L)
    return asdf[R] * po[NN - 1 - L];
  else {
    return (asdf[R] - asdf[L - 1]) * po[NN - 1 - L];
  }
}
void solve(int len) {
  for (int i = 0, j; i + len + len <= n;) {
    if (calc(i, i + len - 1) == calc(i + len, i + len + len - 1)) {
      for (j = i; j < i + len; j++) s[j] = 0;
      i += len;
    } else
      i++;
  }
  int m = 0;
  for (int i = 0; i < n; i++) {
    if (s[i]) {
      s[m++] = s[i];
    }
  }
  n = m;
  s[n] = 0;
  make();
}
bool check(int len) {
  for (int i = 0, j = len, st, ed, md, k; j < n; i += len, j += len) {
    if (s[i] != s[j]) continue;
    st = 1;
    ed = min(len, n - j) + 1;
    while (ed > st + 1) {
      md = st + ed >> 1;
      if (calc(i, i + md - 1) == calc(j, j + md - 1))
        st = md;
      else
        ed = md;
    }
    k = st;
    st = 0;
    ed = min(len, i) + 1;
    while (ed > st + 1) {
      md = st + ed >> 1;
      if (calc(i - md, i - 1) == calc(j - md, j - 1))
        st = md;
      else
        ed = md;
    }
    k += st;
    if (k >= len) return 1;
  }
  return 0;
}
int main() {
  for (int i = po[0] = 1; i < NN; i++) {
    po[i] = po[i - 1] * H;
  }
  scanf("%s", s);
  n = strlen(s);
  n = unique(s, s + n) - s;
  s[n] = 0;
  make();
  for (int i = 2; i + i <= n; i++) {
    if (check(i)) solve(i);
  }
  printf("%s\n", s);
  return 0;
}