Alice was given two x binary grids, and . She wants to convert grid to . She can perform any of the following operations any number of times on grid (she can't modify ):
Output the minimum number of moves that Alice needs to convert to , or if it is impossible to make both grids equal.
INPUT FORMAT
The first lines of the input each contain a string of length - denoting the rows in grid , each character in the string is either or .
The next line is an empty line.
The remaining lines of the input each contain a string of length - denoting the rows in grid , each character in the string is either or .
OUTPUT FORMAT
The first and only line of the output should contain the minimum number of operations Alice needs to convert grid to , or if it's impossible to do so, using the operations in the statement.
One possible sequence of operations that converts the first grid to the second grid is:
Flipping clockwise, and then flipping the first row of .
You cannot convert to in less than operations.