#include <stdio.h>

int main() {
    int num = 0;
    while (scanf("%d", &num) != EOF) 
    {
        int arr[30][30];
        for (int i = 0; i < num; i++)
        {
            for (int j = 0; j <= i; j++)
            {
                if (j == 0 || j == i)
                {
                    arr[i][j] = 1;
                }
                else 
                {
                    arr[i][j] = arr[i-1][j] + arr[i-1][j-1];
                }
            }
        }

        for (int i = 0; i<num; i++)
        {
            for(int j = 0; j <= i; j++)
            {
                printf("%5d",arr[i][j]);
            }

            printf("\n");
        }
    }
    return 0;
}