uva439測資B

Input:
h1 h8
a1 h8
b3 c7
c2 g7
f7 d2
e8 a4
d4 a5
f7 d3
d3 f7
g7 c4
c4 a7
g7 a7
h3 b8
a2 e4
e5 a2
b8 a1
d1 b8
c1 h4
g1 g8
f7 f1
Output:
To get from h1 to h8 takes 5 knight moves.
To get from a1 to h8 takes 6 knight moves.
To get from b3 to c7 takes 3 knight moves.
To get from c2 to g7 takes 3 knight moves.
To get from f7 to d2 takes 3 knight moves.
To get from e8 to a4 takes 4 knight moves.
To get from d4 to a5 takes 2 knight moves.
To get from f7 to d3 takes 2 knight moves.
To get from d3 to f7 takes 2 knight moves.
To get from g7 to c4 takes 3 knight moves.
To get from c4 to a7 takes 3 knight moves.
To get from g7 to a7 takes 4 knight moves.
To get from h3 to b8 takes 5 knight moves.
To get from a2 to e4 takes 2 knight moves.
To get from e5 to a2 takes 3 knight moves.
To get from b8 to a1 takes 4 knight moves.
To get from d1 to b8 takes 5 knight moves.
To get from c1 to h4 takes 4 knight moves.
To get from g1 to g8 takes 5 knight moves.
To get from f7 to f1 takes 4 knight moves.