The Shortest Path of the Knight#1419

The Shortest Path of the Knight

1 segundo
64 megabytes
Difícil (≈1650)

On an 8 \times 8 chessboard, two squares are given. Connect these squares using the shortest path of a knight.

Entrada

The coordinates of the two squares are given, each on a separate line. The coordinates are specified as a letter (from a to h) and a digit (from 1 to 8), without spaces.

Salida

Output the path of the knight, starting at the first square and ending at the second, containing the minimum number of squares.

Ejemplos

Ejemplo 1

Loading
Loading