import java.util.Scanner;

public class KnightsTour {

	public static void main(String[] args) {
		
		// Compute an open knight's tour on a square board of a given size with a given starting position
		// https://en.wikipedia.org/wiki/Knight's_tour 
		Scanner in = new Scanner(System.in);
		System.out.print("Board size? ");
		int size = in.nextInt();
		System.out.print("Starting row (0-based)? ");
		int row = in.nextInt();
		System.out.print("Starting column (0-based)? ");
		int col = in.nextInt();
		boolean[][] isVisited = new boolean[size][size];
		isVisited[row][col] = true;
		int[][] knightMoves = {{2, -1}, {1, -2}, {-1, -2}, {-2, -1}, {-2, 1}, {-1, 2}, {1, 2}, {2, 1}};
		while (true) {
			// find next unvisited position with the least knight moves available
					
			// if no next position, break.
			
			// otherwise, move to next position, print it, and mark it as visited

		}
		
		// check if the entire board has been visited and report result
		boolean allVisited = true;
		for (int r = 0; r < size; r++)
			for (int c = 0; c < size; c++)
				if (!isVisited[r][c])
					allVisited = false;
		
		System.out.println(allVisited ? "All positions were toured." : "All positions were not toured.");
		// Note: Have students run it for different sizes with [0][0] start. What is the minimum size with a solution? (5)
		// For size 5, which starting points have an open knight tour?
		in.close();
	}

}
