n=int(input())
m=int(input())
x=int(input())

total=""
line=""

for i in range(n):
    line=""
    for j in range(m):
        val=int(input())
        for k in range(x):
            line=line+str(val)+" "
    line=line[:-1]
    line+="\n"
    for j in range(x):
        total+=line

print(total)

from subprocess import check_output, STDOUT

psCmd = "ps -aef | grep -v grep | grep Xcode"
o = None
o = check_output(psCmd+";exit 0", stderr=STDOUT, shell=True)