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;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
template <class T>
inline void gn(T &first) {
  char c, sg = 0;
  while (c = getchar(), (c > '9' || c < '0') && c != '-')
    ;
  for ((c == '-' ? sg = 1, c = getchar() : 0), first = 0; c >= '0' && c <= '9';
       c = getchar())
    first = (first << 1) + (first << 3) + c - '0';
  if (sg) first = -first;
}
template <class T>
inline void print(T first) {
  if (first < 0) {
    putchar('-');
    return print(-first);
  }
  if (first < 10) {
    putchar('0' + first);
    return;
  }
  print(first / 10);
  putchar(first % 10 + '0');
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
char s[100011];
unsigned long long h[100011], pw[100011];
const unsigned long long mmod = 79;
int n;
void pre() {
  h[0] = 0;
  for (int i = 1; i <= n; i++) {
    h[i] = h[i - 1] * mmod + s[i];
  }
}
unsigned long long get(int l, int r) { return h[r] - h[l - 1] * pw[r - l + 1]; }
int lcp(int l, int r) {
  if (s[l] != s[r]) return 0;
  int st = 0, ed = r - l + 1, mid;
  while (ed > st + 1) {
    mid = st + ed >> 1;
    if (get(l, l + mid - 1) == get(r, r + mid - 1))
      st = mid;
    else
      ed = mid;
  }
  return st;
}
int lcs(int l, int r) {
  if (s[l] != s[r]) return 0;
  int st = 0, ed = r - l + 1, mid;
  while (ed > st + 1) {
    mid = st + ed >> 1;
    if (get(l - mid + 1, l) == get(r - mid + 1, r))
      st = mid;
    else
      ed = mid;
  }
  return st;
}
bool you(int len) {
  for (int i = 1; i + len <= n; i += len) {
    if (lcp(i, i + len) + lcs(i, i + len) >= len) return true;
  }
  return false;
}
void solve(int len) {
  unsigned long long now = 0;
  int nn = 0;
  for (int i = 1; i <= n; i++) {
    if (i + len <= n + 1 and get(i, i + len - 1) == now)
      i += len - 1;
    else {
      s[++nn] = s[i];
      now = now * mmod + s[nn];
      if (nn > len) {
        now -= pw[len] * s[nn - len];
      }
    }
  }
  n = nn;
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  pw[0] = 1;
  for (int i = 1; i < 100011; i++) pw[i] = pw[i - 1] * mmod;
  pre();
  for (int len = 1; len << 1 <= n; len++) {
    if (you(len)) {
      solve(len);
      pre();
    }
  }
  s[n + 1] = 0;
  puts(s + 1);
  return 0;
}