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 <typename 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, class T1>
inline void gn(T &first, T1 &second) {
  gn(first);
  gn(second);
}
template <class T, class T1, class T2>
inline void gn(T &first, T1 &second, T2 &z) {
  gn(first);
  gn(second);
  gn(z);
}
template <typename 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');
}
template <typename T>
inline void println(T first) {
  print(first), putchar('\n');
}
template <typename T>
inline void printsp(T first) {
  print(first), putchar(' ');
}
template <class T, class T1>
inline void print(T first, T1 second) {
  printsp(first), println(second);
}
template <class T, class T1, class T2>
inline void print(T first, T1 second, T2 z) {
  printsp(first), printsp(second), println(z);
}
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[50050];
unsigned int val[50050][2];
unsigned int pp[50050][2];
int vst[50050], runs;
unsigned int B[2] = {12721, 199};
inline unsigned int calc(int L, int R, int id) {
  return (val[R][id] - val[L - 1][id] * pp[R - L + 1][id]);
}
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  pp[0][0] = pp[0][1] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < 2; j++) pp[i][j] = pp[i - 1][j] * B[j];
  int flag = 1;
  for (int L = 1; L + L <= n; L++) {
    if (flag) {
      for (int i = 1; i <= n; i++)
        for (int j = 0; j < 2; j++)
          val[i][j] = val[i - 1][j] * B[j] + (s[i] - 'a');
    }
    flag = 0;
    runs++;
    for (int i = 1; i + L + L - 1 <= n;) {
      if (calc(i, i + L - 1, 0) == calc(i + L, i + L + L - 1, 0) &&
          calc(i, i + L - 1, 1) == calc(i + L, i + L + L - 1, 1)) {
        for (int j = i; j < i + L; j++) vst[j] = runs;
        i = i + L;
        flag = 1;
      } else
        i++;
    }
    int nn = 0;
    for (int i = 1; i <= n; i++)
      if (vst[i] != runs) s[++nn] = s[i];
    n = nn;
  }
  s[n + 1] = 0;
  puts(s + 1);
  return 0;
}