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;
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 unsigned long long p = 19260817;
unsigned long long pw[50048], hsh[50048];
inline long long gethash(int left, int right) {
  return hsh[right] - hsh[left - 1] * pw[right - left + 1];
}
inline void init_pw() {
  pw[0] = 1;
  for (register int i = 1; i <= len; i++) pw[i] = pw[i - 1] * p;
}
inline void init() {
  hsh[0] = 0;
  for (register int i = 1; i <= len; i++) hsh[i] = hsh[i - 1] * p + s[i];
}
inline int query_lcp(int pos1, int pos2) {
  int l = 1, r = len, mid, res = 0;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (pos2 + mid - 1 <= len &&
        gethash(pos1, pos1 + mid - 1) == gethash(pos2, pos2 + mid - 1))
      res = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  return res;
}
inline int query_lcs(int pos1, int pos2) {
  int l = 1, r = len, mid, res = 0;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (pos1 - mid + 1 >= 1 &&
        gethash(pos1 - mid + 1, pos1) == gethash(pos2 - mid + 1, pos2))
      res = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  return res;
}
inline bool exist(int curlen) {
  int i;
  for (i = 1; i <= len; i += curlen / 2)
    if (i + curlen / 2 <= len && s[i] == s[i + curlen / 2] &&
        query_lcp(i, i + curlen / 2) + query_lcs(i, i + curlen / 2) >=
            curlen / 2)
      return true;
  return false;
}
int main() {
  scanf("%s", s + 1);
  len = strlen(s + 1);
  int i, curlen;
  init_pw();
  init();
  for (curlen = 2; curlen <= len; curlen += 2) {
    if (!exist(curlen)) continue;
    pt = 1;
    tot = curlen / 2;
    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;
    init();
  }
  for (i = 1; i <= len; i++) printf("%c", s[i]);
  puts("");
  return 0;
}