QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 128 MB Puntuación total: 10

#10634. Image

Estadísticas

Bajtazar is a curator at the Byteotian Museum of Modern Art. As part of the latest exhibition, a massive painting by Bajtass was delivered to the museum. The museum staff immediately hung the painting on the largest wall in the museum.

Just before the exhibition opened, Bajtazar decided to personally ensure that it had been prepared correctly. He had just entered the room where Bajtass's work is displayed and began to examine it more closely. Unfortunately, he was unable to interpret the message of the painting. A disturbing thought crossed his mind that perhaps the painting should have been hung differently, rotated by 90 degrees!

There is very little time left until the exhibition opens, so Bajtazar would prefer not to ask the staff to rehang the painting unless it is absolutely necessary. Fortunately, Bajtazar can check his hypothesis more easily - he has an electronic reproduction of the painting at his disposal. Help him and write a program that rotates the image contained in the reproduction by 90 degrees clockwise.

Input

The first line of input contains two integers $n$ and $m$ ($1 \le n, m \le 1\,000$), representing the dimensions of the image. This is followed by the description of the image reproduction: $n$ lines, each containing $m$ characters '.' and '#'.

Output

Your program should output the description of the image reproduction rotated 90 degrees clockwise, in the form of $m$ lines, each containing $n$ characters '.' and '#'.

Examples

Input 1

14 9
.........
.........
.#######.
.#..#....
.#..#....
.#######.
.........
.........
.####....
.#..#....
.#..#....
.#######.
.........
.........

Output 1

..............
..####..####..
..#..#..#..#..
..#..#..#..#..
..####..####..
..#.....#..#..
..#.....#..#..
..#.....#..#..
..............

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.