# -*- coding: utf-8 -*-
"""

Upper Traingular square matrix

Created on Thu Mar 21 18:00:55 2019

@author: Admin
"""


def UpTrgMatrix(matrix,num):
    for  i in range(num):
        for j in range (num):
            if (i>j):
                matrix[i][j]=0;
    return matrix;

num=int(input())
mat=[]

for i in range (num):
    x=input().split();
    mat.append(x);

mat=UpTrgMatrix(mat,num);

for i in range(num):
    for j in range(num):
        if (j==num-1):
            print(mat[i][j], end="")
        else:
            print(mat[i][j], end=" ");
        
    if(i<num-1):
        print();
66429fe91a9fa50d884ce41f57352791351d9b55
<mask token>

<mask token>


def UpTrgMatrix(matrix, num):
    for i in range(num):
        for j in range(num):
            if i > j:
                matrix[i][j] = 0
    return matrix


<mask token>

<mask token>


def UpTrgMatrix(matrix, num):
    for i in range(num):
        for j in range(num):
            if i > j:
                matrix[i][j] = 0
    return matrix


<mask token>
for i in range(num):
    x = input().split()
    mat.append(x)
<mask token>
for i in range(num):
    for j in range(num):
        if j == num - 1:
            print(mat[i][j], end='')
        else:
            print(mat[i][j], end=' ')
    if i < num - 1:
        print()

<mask token>


def UpTrgMatrix(matrix, num):
    for i in range(num):
        for j in range(num):
            if i > j:
                matrix[i][j] = 0
    return matrix


num = int(input())
mat = []
for i in range(num):
    x = input().split()
    mat.append(x)
mat = UpTrgMatrix(mat, num)
for i in range(num):
    for j in range(num):
        if j == num - 1:
            print(mat[i][j], end='')
        else:
            print(mat[i][j], end=' ')
    if i < num - 1:
        print()

# -*- coding: utf-8 -*-
"""

Upper Traingular square matrix

Created on Thu Mar 21 18:00:55 2019

@author: Admin
"""


def UpTrgMatrix(matrix,num):
    for  i in range(num):
        for j in range (num):
            if (i>j):
                matrix[i][j]=0;
    return matrix;

num=int(input())
mat=[]

for i in range (num):
    x=input().split();
    mat.append(x);

mat=UpTrgMatrix(mat,num);

for i in range(num):
    for j in range(num):
        if (j==num-1):
            print(mat[i][j], end="")
        else:
            print(mat[i][j], end=" ");
        
    if(i<num-1):
        print();