#include <stdio.h>
#include <stdlib.h>
int main() {
int n;
scanf("%d",&n);
int **a = (int **)malloc(n * sizeof(int *));
if(a ==NULL){
printf("error");
return -1;
}
for(int i = 0; i < n; i ++){
a[i] = (int *)malloc((i + 1) * sizeof(int));
if(a[i] == NULL){
printf("error");
return -1;
}
a[i][0] = 1;
a[i][i] = 1;
}
for(int i = 2; i < n; i ++){
for(int j = 1; j < i; j ++){
a[i][j] = a[i - 1][j - 1] + a[i - 1][j];
}
}
for(int i = 0; i < n; i ++){
for(int j = 0; j <= i - 1; j ++){
printf("%d ",a[i][j]);
}
printf("%d\n",a[i][i]);
}
return 0;
}