14777 - Graphic Rotation   

Description

Write a program to rotate a pattern. The pattern consists of n rows and m columns of numbers or letters.
The program must rotate the pattern three times and print the result after each rotation.

The input contains n lines, each with m consecutive numbers or letters.
The program must process all characters until EOF.

The output should contain four versions of the pattern:

  1. the original pattern, and

  2. three more patterns obtained by rotating the original one clockwise each time.

Input

N lines, each with m consecutive numbers or letters.

Ex. 01
ab
27

Output

Four versions of the pattern:

  1. the original pattern, and

  2. three more patterns obtained by rotating the original one clockwise each time.

Ex. 01
ab
27
2a0
7b1
72
ba
10
1b7
0a2

Sample Input  Download

Sample Output  Download




Discuss