The following languages are only available languages for the problems from the contest

VK Cup 2016 - Wild Card Round 1 (Unofficial Open Online Mirror):

- J

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ACM-ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tags yet

No tag edit access

H. Rotate Matrix

time limit per test

2 secondsmemory limit per test

64 megabytesinput

standard inputoutput

standard outputYou are given a square matrix of integer numbers. Rotate it 90 degrees clockwise (see examples for clarification of rotation).

Input

The input consists of *n* lines (1 ≤ *n* ≤ 10, *n* is not given explicitly). Each of the lines contains *n* space-separated integers; *j*-th integer in *i*-th line corresponds to matrix element *m*_{ij} (1 ≤ *m*_{ij} ≤ 100).

Output

Output the rotated matrix in the same format as the input.

Examples

Input

1 2 3

4 5 6

7 8 9

Output

7 4 1

8 5 2

9 6 3

Input

1 2 3 4

5 6 7 8

9 10 11 12

13 14 15 16

Output

13 9 5 1

14 10 6 2

15 11 7 3

16 12 8 4

Codeforces (c) Copyright 2010-2017 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Apr/27/2017 16:11:37 (c3).

Desktop version, switch to mobile version.
User lists

Name |
---|