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.
Each line of input contains the encrypted string (length <= 100), and your task is decrypt it and print out the original string.
Problem Setter: Kaustubh Karkare