Move the knight on the chessboard according to the chess rules, such that the knight visits every square only once. Boards with different sizes are supported.