Mr. B has recently discovered the grid named "spiral grid".
Construct the grid like the following figure. (The grid is actually infinite. The figure is only a small part of it.)

Considering traveling in it, you are free to move to any cell containing a composite number or , but traveling to any cell containing a prime number is disallowed. You can travel up, down, left or right, but not diagonally. Write a program to find the length of the shortest path between pairs of nonprime numbers, or report that it is impossible.

Each test case is described by a line of input containing two nonprime integers 1 \le x, y \le 10000.
For each test case, display its case number followed by the length of the shortest path or "impossible" (without quotes) in one line.
Example 1