import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.close(); if (n == 2) { System.out.println("01"); System.out.println("22"); return; } char[][] s = new char[n][n]; for (int i = 0; i < n; i++) { Arrays.fill(s[i], '0'); } for (int i = 0; i < n; i++) { for (int j = i; j < n; j++) { s[i][j] = '2'; } if (i < n - 2) { s[i][i] = '1'; } } for (int i = 0; i < n; i++) { System.out.println(s[i]); } } }