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;
void readi(int &x) {
  int v = 0, f = 1;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-')
    f = -1;
  else
    v = v * 10 + c - '0';
  while (isdigit(c = getchar())) v = v * 10 + c - '0';
  x = v * f;
}
void readll(long long &x) {
  long long v = 0ll, f = 1ll;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-')
    f = -1;
  else
    v = v * 10 + c - '0';
  while (isdigit(c = getchar())) v = v * 10 + c - '0';
  x = v * f;
}
void readc(char &x) {
  char c;
  while ((c = getchar()) == ' ')
    ;
  x = c;
}
void writes(string s) { puts(s.c_str()); }
void writeln() { writes(""); }
void writei(int x) {
  if (!x) putchar('0');
  char a[25];
  int top = 0;
  while (x) {
    a[++top] = (x % 10) + '0';
    x /= 10;
  }
  while (top) {
    putchar(a[top]);
    top--;
  }
}
void writell(long long x) {
  if (!x) putchar('0');
  char a[25];
  int top = 0;
  while (x) {
    a[++top] = (x % 10) + '0';
    x /= 10;
  }
  while (top) {
    putchar(a[top]);
    top--;
  }
}
inline long long inc(int &x) { return ++x; }
inline long long inc(long long &x) { return ++x; }
inline long long inc(int &x, long long y) { return x += y; }
inline long long inc(long long &x, long long y) { return x += y; }
inline double inc(double &x, double y) { return x += y; }
inline long long dec(int &x) { return --x; }
inline long long dec(long long &x) { return --x; }
inline long long dec(int &x, long long y) { return x -= y; }
inline long long dec(long long &x, long long y) { return x -= y; }
inline double dec(double &x, double y) { return x -= y; }
inline long long mul(int &x) { return x = ((long long)x) * x; }
inline long long mul(long long &x) { return x = x * x; }
inline long long mul(int &x, long long y) { return x *= y; }
inline long long mul(long long &x, long long y) { return x *= y; }
inline double mul(double &x, double y) { return x *= y; }
inline long long divi(int &x) {
  long long ans, l, r, mid;
  ans = 0;
  l = 0;
  r = 0x3fffffff;
  while (l < r) {
    mid = (l + r) / 2;
    if (mid * mid < x) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid;
  }
  return ans;
}
inline long long divi(long long &x) {
  long long ans, l, r, mid;
  ans = 0;
  l = 0;
  r = 0x3fffffff;
  while (l < r) {
    mid = (l + r) / 2;
    if (mid * mid < x) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid;
  }
  return ans;
}
inline long long divi(int &x, long long y) { return x /= y; }
inline long long divi(long long &x, long long y) { return x /= y; }
inline double divi(double &x, double y) { return x /= y; }
inline long long mod(int &x, long long y) { return x %= y; }
inline long long mod(long long &x, long long y) { return x %= y; }
int i, j, k, vis[55555];
unsigned long long p[55555], e = 998244353ull * 100000007ull, h[55555];
string s, t;
unsigned long long gth(int l, int r) { return h[r] - h[l - 1] * p[r - l + 1]; }
int lcp(int x, int y) {
  int ans = 0, i;
  for (i = 20; i >= 0; i--) {
    ans += (1 << i);
    if (ans + x - 1 >= s.size() || ans + y - 1 >= s.size()) {
      ans -= (1 << i);
      continue;
    }
    if (gth(x, x + ans - 1) != gth(y, y + ans - 1)) ans -= (1 << i);
  }
  return ans;
}
int lcf(int x, int y) {
  int ans = 0, i;
  for (i = 20; i >= 0; i--) {
    ans += (1 << i);
    if (x - ans + 1 < 1 || y - ans + 1 < 1) {
      ans -= (1 << i);
      continue;
    }
    if (gth(x - ans + 1, x) != gth(y - ans + 1, y)) ans -= (1 << i);
  }
  return ans;
}
bool check(int x) {
  int i;
  for (i = x; i + x - 1 < s.size(); i += x) {
    if (lcp(i, i + x) + lcf(i, i + x) > x) return 1;
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  ;
  cin >> s;
  p[0] = 1;
  s = " " + s;
  for (i = 1; i <= 50000; i++) p[i] = p[i - 1] * e;
  for (i = 1; i < s.size(); i++) h[i] = h[i - 1] * e + s[i];
  for (i = 1; i * 2 < s.size(); i++) {
    if (!check(i)) continue;
    t = " ";
    for (j = 1; j + i * 2 - 1 < s.size(); j++) {
      if (vis[j] != i && gth(j, j + i - 1) == gth(j + i, j + i * 2 - 1)) {
        for (k = j; k < i + j; k++) vis[k] = i;
      }
    }
    for (j = 1; j < s.size(); j++)
      if (vis[j] != i) t.push_back(s[j]);
    s = t;
    for (j = 1; j < s.size(); j++) h[j] = h[j - 1] * e + s[j];
  }
  cout << s.substr(1) << endl;
  return 0;
}