import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Backtracking_knight { static int n; static ArrayList paths; public static void main(String[] args) { Scanner in = new Scanner(System.in); n = in.nextInt(); for(int i=1;i(); if(!start(grid,0,0,i,j,0)) System.out.print(-1+" "); else{ int min=paths.get(0); for(int a:paths){ if(a= 0 && x < n && y >= 0 && y < n && sol[x][y] == false); } }