Universal Cup Judging System

Universal Cup

Time Limit: 1.0 s Memory Limit: 1024 MB Total points: 100 Hackable ✓
Statistics

雍正皇帝(1678年12月13日-1735年10月8日)是中国清朝的第五位皇帝。他是一位非常勤政的统治者。他严厉打击腐败,其统治以专制、高效和强力著称。

雍正无法容忍人们说关于清朝或他本人的坏话。因此,他发起了一场名为“文字狱”的运动。“文字狱”意为文学上的审讯。在著名的庄廷鑨案中,因出版了一部未经授权的明史,三年内有70多人被处决。

简而言之,在雍正统治下,人们如果想写点什么,必须非常小心。因此,一些诗人以一种非常奇特的方式写诗,只有他们朋友圈里的人才能读懂。这种诗被称为“密诗”。

密诗是一个 $N \times N$ 的字符矩阵,看起来杂乱无章,毫无意义。但如果你按照特定的顺序阅读这些字符,你就能理解它。该顺序如下图左侧所示:

按照箭头指示的顺序,你可以得到 “THISISAVERYGOODPOEMITHINK”,这便有了意义。

但过了一段时间,诗人们发现雍正的一位名为“滴血人”的特务也能读懂这种诗。这很危险。因此,他们引入了一种新的写诗顺序,如下图右侧所示。他们希望将按照旧顺序(如图1所示)编写的旧诗转换为新顺序的诗。请帮助他们。

输入格式

输入的第一行是一个整数 $N$ ($1 \le N \le 100$),表示这首诗是一个由大写字母组成的 $N \times N$ 矩阵。

接下来 $N$ 行,每行是一个长度为 $N$ 的字符串。这 $N$ 行代表了旧顺序下的诗。

输出格式

输出 $N$ 行,每行是一个长度为 $N$ 的字符串,表示转换后的诗。

样例

输入 1

5
THSAD
IIVOP
SEOOH
RGETI
YMINK

输出 1

THISI
POEMS
DNKIA
OIHTV
OGYRE

输入 2

2
AB
CD

输出 2

AB
DC

输入 3

4
ABCD
EFGH
IJKL
MNOP

输出 3

ABEI
KHLF
NPOC
MJGD

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.