e-olymp
favorite We need a little bit of your help to keep things running, click on this banner to learn more
Problems

Шифр

Шифр

Vasya invented his method of encryption. It consists, he follows:

1. Line of text is supplemented by the last character of the string zero or more times until the long string length will not be a square integer. Call this numberN.

2. Then the text is transferred into the square, consisting ofNxNcells. The beginning of the text is transferred into the first row of the square from left to right, the following characters - the second line, etc.

3. Once the box is full, data is read out, but not in rows, as they were entered into it, and the columns. At the beginning of the line characters are entered the first column from top to bottom, then the symbols of the second column, etc.

The resultant string is the ciphertext.

Help Vasya - write a program that was implemented would have invented a way to encrypt them.

Input

In the first line of input data (ending with a newline) is the original text, composed of Latin letters. Length of the line from 0 to 25 characters.

Output

Remove one row - the result of encryption of a given text.

Time limit 1 second
Memory limit 64 MiB
Input example #1
EXAMPLE
Output example #1
EMEXPEALE