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(); int[][] matrix = new int[n-1][n-1]; for(int i = 1; i < n; i++) { for(int j = i; j < n; j++) { if (i == 1 && j == 1) { matrix[i-1][j-1] = n-1; continue; } if (i == n-1 && j == n-1) { matrix[i-1][j-1] = 1; continue; } if (i > (n-1)/2 && j > (n-1)/2) { matrix[i-1][j-1] = -1; matrix[j-1][i-1] = -1; continue; } if (i+j == n-1) { matrix[i-1][j-1] = 2; matrix[j-1][i-1] = 2; continue; } if ((n-1) % i == 0 || (n-1) % j == 0) { if (n-1 > i) { if ((n-1) % i == 0) { matrix[i-1][j-1] = ((n-1)/i)*2; matrix[j-1][i-1] = ((n-1)/i)*2; continue; } } if (n-1 > j) { if ((n-1) % j == 0) { matrix[i-1][j-1] = ((n-1)/j)*2; matrix[j-1][i-1] = ((n-1)/j)*2; continue; } } } matrix[i-1][j-1] = 0; matrix[j-1][i-1] = 0; } } for(int[] i : matrix) { for(int j : i) { System.out.print(j+ " "); } System.out.println(); } } }