@staticmethod
def b():
    (n, *s) = sys.stdin.read().split()
    n = int(n)
    for j in range(n):
        row = ''
        for i in range((n - 1), (- 1), (- 1)):
            row += s[i][j]
        print(row)
@staticmethod
def b():
    (n, *s) = sys.stdin.read().split()
    n = int(n)
    for j in range(n):
        row = 
        for i in range((n - 1), (- 1), (- 1)):
            row += s[i][j]
        print(row)