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.
#include <bits/stdc++.h>
using namespace std;
const int MOD = 10007;
const long long LINF = 2e16;
const int INF = 2e9;
const int magic = 348;
const double eps = 1e-10;
const double pi = 3.14159265;
inline int getint() {
  char ch;
  int res;
  bool f;
  while (!isdigit(ch = getchar()) && ch != '-') {
  }
  if (ch == '-')
    f = false, res = 0;
  else
    f = true, res = ch - '0';
  while (isdigit(ch = getchar())) res = res * 10 + ch - '0';
  return f ? res : -res;
}
char s[50048];
int len;
char tmp[50048];
int pt, tot;
const long long p1 = 998244353, p2 = 19260817;
const long long m1 = 1e9 + 7, m2 = 1e9 + 9;
long long pw1[50048], pw2[50048], hsh1[50048], hsh2[50048];
inline long long mod1(long long first) {
  while (first >= m1) first -= m1;
  while (first < 0) first += m1;
  return first;
}
inline long long mod2(long long first) {
  while (first >= m2) first -= m2;
  while (first < 0) first += m2;
  return first;
}
inline long long gethash1(int left, int right) {
  return hsh1[right] - hsh1[left - 1] * pw1[right - left + 1];
}
inline long long gethash2(int left, int right) {
  return mod2(hsh2[right] - (hsh2[left - 1] * pw2[right - left + 1]) % m2);
}
inline void init_pw() {
  pw1[0] = pw2[0] = 1;
  for (register int i = 1; i <= len; i++)
    pw1[i] = pw1[i - 1] * p1, pw2[i] = pw2[i - 1] * p2;
}
int main() {
  scanf("%s", s + 1);
  len = strlen(s + 1);
  int i, curlen;
  init_pw();
  for (curlen = 2; curlen <= len; curlen += 2) {
    pt = 1;
    tot = curlen / 2;
    hsh1[0] = hsh2[0] = 0;
    int sl = 0;
    for (i = 1; i <= curlen / 2; i++) tmp[i] = s[i];
    for (i = curlen / 2 + 1; i <= len; i++) {
      tmp[++tot] = s[i];
      if (tmp[tot] == tmp[tot - curlen / 2])
        sl++;
      else
        sl = 0;
      if (sl == curlen / 2) tot -= curlen / 2, sl = 0;
    }
    for (i = curlen / 2 + 1; i <= tot; i++) s[i] = tmp[i];
    len = tot;
  }
  for (i = 1; i <= len; i++) printf("%c", s[i]);
  puts("");
  return 0;
}
