#include <iostream>
#include <string>
#include<math.h>
using namespace std;
int main()
{
int n;
int a[30][30];
while (cin >> n)
{
for (int i = 0; i < n; i++)
{
a[i][0] = 1;
}
for (int i = 1; i < n; i++)
for (int j = 1; j <= i;j++)
{
a[i][j] = a[i - 1][j - 1] + a[i - 1][j];
if (i == j)
a[i][j] = 1;
}
for (int i = 0; i < n; i++)
for (int j = 0; j <= i; j++)
{
if (i == j)
cout << a[i][j] << endl;
else cout << a[i][j] << " ";
}
cout << endl;
}
return 0;
}
#include <string>
#include<math.h>
using namespace std;
int main()
{
int n;
int a[30][30];
while (cin >> n)
{
for (int i = 0; i < n; i++)
{
a[i][0] = 1;
}
for (int i = 1; i < n; i++)
for (int j = 1; j <= i;j++)
{
a[i][j] = a[i - 1][j - 1] + a[i - 1][j];
if (i == j)
a[i][j] = 1;
}
for (int i = 0; i < n; i++)
for (int j = 0; j <= i; j++)
{
if (i == j)
cout << a[i][j] << endl;
else cout << a[i][j] << " ";
}
cout << endl;
}
return 0;
}