Cipher#475

Cipher

1 second
64 megabytes
Very easy

Vasya has invented his own encryption method. This method consists of the following steps:

  1. Given a string of text. It is padded with its last character zero or more times so that its length becomes a perfect square of some integer. Denote this number as .

  2. The resulting text is written into a square of size N \times N, filling the square row by row, from left to right, top to bottom.

  3. After filling the square, the text is read out by columns: first the characters of the first column from top to bottom, then the second column, and so on.

In this way, the encrypted text is formed.

Write a program that implements this encryption method.

Input

The first line of the input (ending with a newline) contains the original text, consisting of Latin letters. The length of the string is from to characters.

Output

Print a single line — the result of encrypting the given text.

Examples

Example 1

Loading
Loading