import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); for (int i = 1; i < n; i++) { String out = ""; for (int j = 1; j < n; j++) { if (i == j && i == n-1) out += "1 "; else if (i > n/2 && j > n/2) out += "-1 "; else if (i + j == n-1) out += "2 "; else if ((i == 1 && j == n-1) || (i == n-1 && j == 1)) out += (n-1)*2 + " "; else out += n-1 + " "; } System.out.println(out.trim()); } } }