luogu#P2191. 小Z的情书

小Z的情书

Background

As everyone knows, Xiao Z is the very model of a tall, rich, and handsome guy, so he has many, many girls. Xiao Z is going to write a love letter to his girls. Being cautious, he certainly would not write it plainly on paper (otherwise, if his mischievous friends found it, wouldn’t that be bad?).

Problem Description

Although Xiao Z was very careful, the cunning Xiao D still discovered the trick. Being generous, Xiao D naturally wants to share this secret with everyone. Xiao Z starts with two N×NN \times N sheets of paper: one is transparent, and the other has letters on it. Then Xiao Z blacks out some cells on the transparent sheet. Next, he gives both sheets to the girl. The girl and Xiao Z have agreed in advance to read it as follows: first place the transparent sheet on top of the other sheet, then write down the exposed letters in row-major order, from top to bottom and from left to right; then rotate by 9090 degrees and read again... do this a total of four times... see the sample.

Xiao D somehow got the love letter. Please enjoy it together and print out the content.

Input Format

Line 11: an integer NN.

Lines 22 to N+1N+1: each line has NN characters, representing skj's transparent sheet, where O indicates an unblackened cell and # indicates a blackened cell.

Lines N+2N+2 to 2N+12N+1: each line has NN characters, containing only uppercase letters, representing the other sheet as described.

Output Format

One line: the content of the love letter.

4
##O#
#O#O
####
###O
ARAO
PCEM
LEEN
TURC
ACMCENTRALEUROPE

Hint

1N10001 \leq N \leq 1000.

Translated by ChatGPT 5