def triangle(n):
L=[]
for i in range(n):
if i==0:
L.append([1])
elif i==1:
L.append([1,1])
else:
y =[]
for j in range(i+1):
if j==0 or j==i:
y.append(1)
else:
y.append(L[i-1][j]+L[i-1][j-1])
L.append(y)
return L
n=int(input("请输入杨辉三角打印的行数:"))
x=triangle(n)
for i in range(len(x)):
s=str(x[i])
print(s.center(n*10))