All Submissions


In cryptography, a Caesar cipher is one of the simplest and most widely known encryption techniques.
A simple algorithm is given below:
  • Take a string (consisting of only alphanumeric characters).
  • Add underscore characters at the end to increase the length of the string to a perfect square.
  • Arrange the characters row-wise in a square matrix.
  • Read out the characters column-wise from the matrix to obtain the encrypted string.

Given an encrypted string, your task is to recover the original text.

Input/Output Specifications

Each line of input contains the encrypted string (length <= 100), and your task is decrypt it and print out the original string.

Sample Input


ACBD
TIEPHSXLIAAESNM_


Sample Output


ABCD
THISISANEXAMPLE


Problem Setter: Kaustubh Karkare

Languages: C,C++,C#,Java,JavaScript,Pascal,Perl,PHP,Python,Ruby

Time Limit: 1 Second(s)
Score: 100 Point(s)
Input File Limit: 50000 Bytes

Submit

Login to post clarification.

No Clarifications.

Contest

Mode Judge

Passive

Online

Overall Rankings

RankNameScore
1xyz0
2Ams0
3TIP0
4team420
5xyzz0
6asdasdasd0
7abcd0
8khankhan0
9Gabriel0
10gigel0