On a standard chessboard (8\times 8), there are knights: one Red, one Green. Usually, they move freely, but today is special—the Green knight's birthday. To celebrate, the Green knight wants to meet the Red knight on the same square. Unlike traditional knights, the Red and Green knights move simultaneously and can share the same square without capturing each other. Your task is to determine the minimum number of moves needed for them to meet on the same square, or if it is impossible.
The input contains the coordinates of both knights, formatted in standard chess notation: a lowercase Latin letter (from to ) and a digit (from to ), indicating the column and row, respectively.
Output the minimum number of moves required for the knights to meet, or if they cannot meet.
Example 1