String Stretching

No attempts yetTime limit1sMemory limit256 MB

Problem

Build a new string ss from a string pp like this. Begin with the empty string and insert pp. Then pick any position in the current string, including the very beginning and the very end, and insert pp there again. Repeat this as many times as you like.

Suppose pp is hello. Starting from the empty string, the string can grow like this, with the copy inserted at each step in bold.

  1. (the empty string)
  2. hello
  3. hhelloello
  4. hhelloelhellolo
  5. hhehellolloelhellolo

Four copies of hello went in, so the final string is hhehellolloelhellolo.

You are given the final string ss. Find the shortest string pp that could have produced it. If several strings of that length could have produced ss, find the one that comes first in alphabetical order.

Input

The first line contains the string ss. It consists of lowercase letters only, and its length is between 1 and 200.

Output

Print on the first line the shortest string pp that could have produced ss. If more than one string of that length works, print the one that comes first in alphabetical order.