import java.util.*;
public class Main {
        public static void main(String[] args){
            Scanner sc = new Scanner(System.in);
            while(sc.hasNext()){
                int n = sc.nextInt();
                int start=1;
                int value=0;
                for(int i=0;i<n;i++){
                    start=start+i;
                    value=start;
                    for(int j=0;j<n-i;j++){
                        //j表示当前行输出的列数
                        System.out.print(value+" ");
                        value +=j+2+i;
                    }
                    System.out.println();
                }
            }
        }
}