import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (j > 0) { sb.append(" "); } sb.append((2 * i - j + n) % n + 1); } sb.append("\n"); } System.out.print(sb); } }