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, const U &b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, const 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 T1, class T2>
inline void gn(T1 &x1, T2 &x2) {
  gn(x1), gn(x2);
}
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;
}
const int B = 29;
char s[50050];
int n;
long long H[50050], pp[50050];
void pre() {
  n = strlen(s + 1);
  for (int i = 1; i <= n; i++) H[i] = H[i - 1] * B + s[i] - 'a' + 1;
}
long long calc(int st, int ed) {
  if (st > ed) return 0;
  return H[ed] - H[st - 1] * pp[ed - st + 1];
}
int lcp(int i, int j) {
  int st = 0, ed = n - j + 2;
  while (ed - st > 1) {
    int mid = st + ed >> 1;
    if (calc(i, i + mid - 1) == calc(j, j + mid - 1))
      st = mid;
    else
      ed = mid;
  }
  return st;
}
int lcs(int i, int j) {
  int st = 0, ed = i + 1;
  while (ed - st > 1) {
    int mid = st + ed >> 1;
    if (calc(i - mid + 1, i) == calc(j - mid + 1, j))
      st = mid;
    else
      ed = mid;
  }
  return st;
}
bool can(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;
}
int cnt[50050];
void solve(int len) {
  for (int i = 1; i <= n; i++) cnt[i] = 0;
  for (int i = len + 1; i + len - 1 <= n; i++) {
    if (calc(i - len, i - 1) == calc(i, i + len - 1)) {
      cnt[i - len]++;
      cnt[i]--;
      i += len - 1;
    }
  }
  for (int i = 1; i <= n; i++) cnt[i] += cnt[i - 1];
  int nn = 0;
  for (int i = 1; i <= n; i++)
    if (!cnt[i]) s[++nn] = s[i];
  s[(n = nn) + 1] = 0;
}
int main() {
  for (int i = pp[0] = 1; i < 50050; i++) pp[i] = pp[i - 1] * B;
  scanf("%s", s + 1);
  pre();
  for (int len = 1; len * 2 <= n; len++) {
    if (can(len)) {
      solve(len);
      pre();
    }
  }
  puts(s + 1);
  return 0;
}