{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cimg src\u003d\"CDN_BASE_URL/7c7b3f87295d3c387b8e9bfb99992141?v\u003d1724311735\" align\u003d\"right\"\u003e\u003cb\u003eBackground\u003c/b\u003e\r\u003cbr\u003eThe knight is getting bored of seeing the same black and white squares again and again and has decided to make a journey\r\u003cbr\u003earound the world. Whenever a knight moves, it is two squares in one direction and one square perpendicular to this. The world of a knight is the chessboard he is living on. Our knight lives on a chessboard that has a smaller area than a regular 8 * 8 board, but it is still rectangular. Can you help this adventurous knight to make travel plans?\r\u003cbr\u003e\r\u003cbr\u003e\u003cb\u003eProblem\u003c/b\u003e\r\u003cbr\u003eFind a path such that the knight visits every square once. The knight can start and end on any square of the board."}},{"title":"Input","value":{"format":"HTML","content":"The input begins with a positive integer n in the first line. The following lines contain n test cases. Each test case consists of a single line with two positive integers p and q, such that 1 \u0026lt;\u003d p * q \u0026lt;\u003d 26. This represents a p * q chessboard, where p describes how many different square numbers 1, . . . , p exist, q describes how many different square letters exist. These are the first q letters of the Latin alphabet: A, . . ."}},{"title":"Output","value":{"format":"HTML","content":"The output for every scenario begins with a line containing \"Scenario #i:\", where i is the number of the scenario starting at 1. Then print a single line containing the lexicographically first path that visits all squares of the chessboard with knight moves followed by an empty line. The path should be given on a single line by concatenating the names of the visited squares. Each square name consists of a capital letter followed by a number.\r\u003cbr\u003eIf no such path exist, you should output impossible on a single line."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\r\n1 1\r\n2 3\r\n4 3\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eScenario #1:\r\nA1\r\n\r\nScenario #2:\r\nimpossible\r\n\r\nScenario #3:\r\nA1B3C1A2B4C2A3B1C3A4B2C4\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}