import java.util.*;
public class tab16{
	public static void main(String[]args){
		Scanner sc = new Scanner(System.in);
		System.out.print("Koliko je dolg rob tab??: ");
		int a = sc.nextInt();
		
		int tab[][] = new int[a][a];
		
		for (int v = 0; v<tab.length; v++){
			for (int s = 0; s<tab[v].length; s++){
				if (v == 0)
					tab[v][s] = 1;
				else if (v == s)
					tab[v][s] = 1;
				else if (s == 0)
					tab[v][s] = 1;
				else if (s == a-1)
					tab[v][s] = 1;
				else if (v == a-1)
					tab[v][s] = 1;
				else if (s + v == a - 1)
					tab[v][s] = 1;
				else
					tab[v][s] = 0;
				System.out.print(tab[v][s] + " ");
			}
			System.out.println();
		}
	}
}