• محدودیت زمان: ۱ ثانیه
  • محدودیت حافظه: ۲۵۶ مگابایت

Pari loves spiderman and how he hangs upside down from the ceiling, so she likes to rotate everything. Right now she is rotating tables of letters. She wrote an R×CR \times C table onto a piece of paper. She has also chosen an angle KK, a multiple of 4545, and wants to rotate her table that many degrees clockwise.

It turns out this task is a bit too hard for Pari, so help her out.

ورودی

The first line contains two integers RR and CC, the number of rows and columns in Pari's table.

Each of the next RR lines contains one row of Pari's table, a string of CC lowercase letters. The last line contains an integer KK, a multiple of 4545 between 00 and 360360 (inclusive).

1R101 \le R \le 10 1C101 \le C \le 10

خروجی

Output Pari's table rotated KK degrees clockwise. The output must contain the smallest number of rows and columns possible. Some rows may have some leading spaces, but extra leading or trailing space is now allowed.

مثال

ورودی نمونه ۱

3 4
pari
sina
mari
45
Plain text

خروجی نمونه ۱

  p
 s a
m i r
 a n i
  r a
   i
Plain text

ورودی نمونه ۲

3 4
pari
sina
mari
90
Plain text

خروجی نمونه ۲

msp
aia
rnr
iai
Plain text

ورودی نمونه ۳

3 4
pari
sina
mari
315
Plain text

خروجی نمونه ۳

   i
  r a
 a n i
p i r
 s a
  m
Plain text

ارسال پاسخ برای این سؤال
فایلی انتخاب نشده است.