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>
#pragma comment(linker, "/STACK:1024000000,1024000000")
const int inf = 1e9;
const double eps = 1e-8;
const double pi = acos(-1.0);
template <class T>
inline bool rd(T &ret) {
  char c;
  int sgn;
  if (c = getchar(), c == EOF) return 0;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1 : 1;
  ret = (c == '-') ? 0 : (c - '0');
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  ret *= sgn;
  return 1;
}
template <class T>
inline void pt(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) pt(x / 10);
  putchar(x % 10 + '0');
}
using namespace std;
const int N = 100000 + 10;
const int MAGIC = 311, MOD = 1e9 + 7;
template <class T>
struct HASH {
  T h[N], base[N];
  inline void init(char *s, int len) {
    h[0] = 1;
    for (int i = 1; i <= len; ++i)
      h[i] = ((long long)h[i - 1] * MAGIC % MOD + s[i - 1]) % MOD;
    base[0] = 1;
    for (int i = 1; i <= len; ++i)
      base[i] = (long long)base[i - 1] * MAGIC % MOD;
  }
  inline T get(int l, int r) {
    return (h[r] - (long long)h[l - 1] * base[r - l + 1] % MOD + MOD) % MOD;
  }
};
HASH<long long> h;
char s[N];
int n;
int find_l(int l, int r, int x, int y) {
  if (s[x - 1] != s[y - 1]) return 0;
  int ans = 1;
  r = min(x - 1, r);
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (h.get(x - mid, x) == h.get(y - mid, y))
      l = mid + 1, ans = mid + 1;
    else
      r = mid - 1;
  }
  return ans;
}
int find_r(int l, int r, int x, int y) {
  if (s[x - 1] != s[y - 1]) return 0;
  int ans = 1;
  r = min(r, n - y);
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (h.get(x, x + mid) == h.get(y, y + mid))
      l = mid + 1, ans = mid + 1;
    else
      r = mid - 1;
  }
  return ans;
}
bool check(int x) {
  for (int i = 1; i + x <= n; i += x) {
    int a = find_l(1, x - 1, i, i + x);
    int b = find_r(1, x - 1, i, i + x);
    if (a + b > x) return true;
  }
  return false;
}
int no[N];
char str[N];
void work(int x) {
  memset(no, 0, sizeof no);
  for (int i = 1; i + x + x - 1 <= n; i++) {
    if (h.get(i, i + x - 1) == h.get(i + x, i + x + x - 1))
      no[i + x - 1]++, no[i + x + x - 1]--, i = i + x - 1;
  }
  int top = 0;
  for (int i = 0; i < n; i++) {
    if (i) no[i] += no[i - 1];
    if (no[i] == 0) str[top++] = s[i];
  }
  str[n = top] = 0;
  for (int i = 0; i <= top; i++) s[i] = str[i];
  h.init(s, n);
}
int main() {
  while (~scanf("%s", s)) {
    n = strlen(s);
    h.init(s, n);
    for (int i = 1; i <= n / 2; i++)
      if (check(i)) work(i);
    printf("%s\n", s);
  }
  return 0;
}