import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static boolean possible(int x,int y) { if(x=0 && y>=0) return true; else return false; } public static void findSolution(int p, int q, int[][] sol, int[] xmove, int[] ymove, int count) { if(p==n-1 && q==n-1 || count>n*4) return; for(int k=0;k<8;k++) { if(possible(p+xmove[k],q+ymove[k])) { if(sol[p+xmove[k]][q+ymove[k]]==-1 || sol[p+xmove[k]][q+ymove[k]]>sol[p][q]+1) { count++; sol[p+xmove[k]][q+ymove[k]]=sol[p][q]+1; findSolution(p+xmove[k],q+ymove[k],sol,xmove,ymove,count); } } } } static int n; public static void main(String[] args) { Scanner in = new Scanner(System.in); n = in.nextInt(); int ans[][]=new int[n][n]; // your code goes here for(int i=1;ii) System.out.print(ans[j][i]+" "); else System.out.print(ans[i][j]+" "); } System.out.println(); } } }