import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; import java.awt.Point; public class Solution { private static int getMoveCount(int i, int j, int n) { Set visitedPointSet = new HashSet(); List pointList = new ArrayList(); pointList.add(new Point(0, 0)); int moveCount = 0; while (pointList.size() > 0) { moveCount++; List nextPointList = new ArrayList(); for (int k = 0; k < pointList.size(); k++) { Point[] nextPoints = new Point[8]; int x = (int)pointList.get(k).getX(); int y = (int)pointList.get(k).getY(); nextPoints[0] = new Point(x - i, y - j); nextPoints[1] = new Point(x + i, y - j); nextPoints[2] = new Point(x - i, y + j); nextPoints[3] = new Point(x + i, y + j); nextPoints[4] = new Point(x - j, y - i); nextPoints[5] = new Point(x + j, y - i); nextPoints[6] = new Point(x - j, y + i); nextPoints[7] = new Point(x + j, y + i); for (int l = 0; l < nextPoints.length; l++) { if ((nextPoints[l].getX() < 0) || (nextPoints[l].getX() >= n) || (nextPoints[l].getY() < 0) || (nextPoints[l].getY() >= n)) continue; if ((nextPoints[l].getX() == n - 1) & (nextPoints[l].getY() == n - 1)) return moveCount; if (!visitedPointSet.add(nextPoints[l])) continue; nextPointList.add(nextPoints[l]); } } pointList = nextPointList; } return -1; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); for (int i = 1; i < n; i++) { for (int j = 1; j < n; j++) { System.out.print(getMoveCount(i, j, n)); if (j != n - 1) System.out.print(' '); } System.out.println(); } } }