Cheap, small industrial scanners can only capture grayscale images, in which each pixel holds an integer intensity in the range $[0, 255]$. A company that builds vending machines wants to use these inexpensive scanners to validate the tokens its machines accept. A token is a small square metal chip with holes punched in specific positions; tokens with different hole patterns represent different values.

Fig. 1: Token for a vending machine
When a customer inserts a token, the scanner produces an image of it and a program decides whether the token is valid. In the scanned image, metal shows up as dark pixels (values near $0$) and holes as light pixels (values near $255$). Two difficulties complicate the check. First, because the token is square, the customer can drop it into the slot in several orientations: any of the four $90°$ rotations, and, because the chip can also be flipped over, the mirror image of each rotation — eight orientations in total. Second, these cheap scanners are noisy, so the captured image contains errors. To validate the token, the machine compares the scanned image against a standard image of the token that was previously captured with a high-quality scanner.
Write a program that, given the standard image and a scanned image, reports the confidence degree that the inserted token is valid. The confidence degree is the percentage of pixels in the scanned image whose intensity differs by at most $100$ from the corresponding pixel of the standard image. Because the token may have been inserted in any of the eight orientations, report the highest confidence degree over all of them.
The input contains several test cases. Each test case begins with a line holding one integer $L$, the side length of the square image in pixels ($1 \le L \le 400$). The next $L$ lines contain $L$ integers each and give the pixel values of the standard image, row by row. The following $L$ lines give, in the same way, the pixel values of the scanned image. Every pixel value is an integer in $[0, 255]$.
The input ends with a line containing $L = 0$, which must not be processed.
For each test case, print a single line with the confidence degree for that image. Print it as a real number rounded to exactly two decimal places. (The test data avoid values that fall on a rounding boundary.)