import java.util.Scanner;

public class Main {

    static void printArr(int a[][]){
        for (int i = 0; i < a.length; i++) {
            for (int j = 0; j < a[0].length-i; j++) {
                System.out.print(a[i][j]+" ");
            }
            System.out.println();
        }
    }

    static void initArr(int a[][],int col)
    {
        int len = col;
        int initVal=len*(len+1)/2;
        for (int i = 0; i < len; i++) {
            a[i][len-i-1]=initVal;
            initVal--;
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()){
            int num = sc.nextInt();
            int a[][] = new int[num][num];
            for (int i = 0; i < num; i++) {
                initArr(a,num-i);
            }
            printArr(a);
        }
    }
}