{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits each square of a given set of n squares on a chessboard exactly once. He thinks that the most difficult part of the problem is determining the smallest number of knight moves between two given squares and that, once you have accomplished this, finding the tour would be easy.\u003cbr\u003eOf course you know that it is vice versa. So you offer him to write a program that solves the \"difficult\" part. \u003cbr\u003e\u003cbr\u003eYour job is to write a program that takes two squares a and b as input and then determines the number of knight moves on a shortest route from a to b. "}},{"title":"Input","value":{"format":"HTML","content":"The input will contain one or more test cases. Each test case consists of one line containing two squares separated by one space. A square is a string consisting of a letter (a-h) representing the column and a digit (1-8) representing the row on the chessboard."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, print one line saying \"To get from xx to yy takes n knight moves.\"."}},{"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\u003ee2 e4\r\na1 b2\r\nb2 c3\r\na1 h8\r\na1 h7\r\nh8 a1\r\nb1 c3\r\nf6 f6\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eTo get from e2 to e4 takes 2 knight moves.\r\nTo get from a1 to b2 takes 4 knight moves.\r\nTo get from b2 to c3 takes 2 knight moves.\r\nTo get from a1 to h8 takes 6 knight moves.\r\nTo get from a1 to h7 takes 5 knight moves.\r\nTo get from h8 to a1 takes 6 knight moves.\r\nTo get from b1 to c3 takes 1 knight moves.\r\nTo get from f6 to f6 takes 0 knight moves.\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}