include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int pasc[31][31] = { 0 };
for (int i = 0; i < n; i++)
{
for (int j = 0; j < i+1; j++)//控制每行输入个数
{
if (j == 0 || i==j)//如果是两边就赋值为1
{
pasc[i][j] = 1;
}
else//如果不是就等上面的相邻两数相加
{
pasc[i][j] = pasc[i - 1][j - 1] + pasc[i - 1][j];
}
printf("%5d", pasc[i][j]);//输出5位整型数, 不够5位右对齐
}
printf("\n");
}
return 0;
}