Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
148 kB
1
Indexable
Never
Fast robot
*** de bai
Mr. Noh is responsible for enhancing the movement of a robot faster.
Now, Mr. Noh is thinking like this: The speed of the robot decreases when it changes its direction.
Therefore, it requires a study of the acceleration in direction changes.
However, the better method than that is to use the route with the minimum number of direction changes when it moves from point A to point B.


Because of that, he studies a maze.
When the maze information is given, he tries to create a program to move it from the starting point to the arriving point based on the minimized direction changes.


Let’s find out the minimum direction changes possible from the starting point to the arriving point when the maze information is given.


Time limit : 1 sec (Java : 2 sec)


[Input]
There can be more than one test case in the input file. The first line has T, the number of test cases.
Then the totally T test cases are provided in the following lines (T ≤ 10 )
In each test case, The width and height of the maze are given as N & M separately at the first row. (1 ≤ N, M ≤ 200)
The horizontal coordinate and vertical coordinate of the starting point, and the horizontal coordinate and vertical coordinate of the arriving point are given separately in order at the second row.
Information of the maze is given from the third row the number (N). At this time, the path indicates 0; the wall indicates 1. There is no blank each other.


[Output]
In case of being reachable from the starting point to the arriving point, generate the minimum direction change frequency between two points.
If not, generate "-1"


[I/O Example]

Input

2
7 7
1 2 7 5
1111111
0000011
1011001
1011100
1011110
1000000
1111111
7 7
1 2 7 6
1111111
0000001
1011000
1011100
1011110
1000000
1111111


Output

3

2

*** test case
10
50 60
4 4 38 22
00000000000000000000000000011111111111000000000000
00000000001011111011111111011111111111011001001000
01101111111011111011111111011111111111011001001110
01101111111011111011111111011111111000001001001100
01101111111011111011111111000000000000000000000000
00000000000000000000000000000000000011001100001100
01101111111111111011111111011111110000000000001100
01101111111111111011111111011111110011001110001100
01101111111111111011111111011111110011001110001100
00000000000000000000111111011111111011111110001110
01101111111111111010111111011111111011111110001110
00001111111111111010111111011110000000000000000000
00000000000000000000000000011110111011111110100010
00000111111111111010111111111110111000000000000000
01100111111111111010111111111110111111111110110110
01100111111111111010111111111110110000000000000110
01100000000000000000111111111110110111111110100110
01100011111100000000000000000000000111111110000110
01100000000000000011111111111110111111111111100110
01101011111100011111111111111110111111111111100110
00101011111100011111111111111110111110000000000110
00101011111100011111111111111110111110111111110110
00101011111100011111111111111110111110111100000010
00100000000000011111111111111110111110111101110010
00100011111101011111111111111110111110111101110000
00000000000000011111111111111110000000000000000000
00000011100001011111111111111111111110110000000000
01000000101111011111111111111111111110110101111000
01000010101111011111111111111111111110110101111000
00000000000001011111111111111111111110110101111000
01000000001101011111111111111111100000110000001010
01001010111101011111111111111111101111110001101000
01001000000000000000000000000000000000000000000000
01001000111101011111111111111111101111110101101010
01000000000000000000111111111111101111110101101010
01101000111100000000111111111111101111110101101010
01000000000000011110111111111111101111110101101010
01001000111110011110111111111111101111110101101010
00000000000000000000000000111111100000000101101000
01001011111110011110111110111111111110000000000010
01001000000000000000111110111000000000010101101110
00000001111110011100111110111011111110010100000000
00000000000000000000111110000000000000000000101111
00000011111110011100111100111011111110010110101111
01000011111110011100000000001011111110010110101111
00000011111110001100011100101011111110010110000111
01000000000000000000000000101001111110010110000001
00001011111110101100000000101101111110010110000101
11101010000000000000011100101101111110010110000101
00000010111110101100111100101101111110010110000101
01101010111110100000000000000001111110010110000000
01101010111110111100110000001101100000000000000000
01101000000000111100000100111101000110010110000100
00000000111110111100100100111101000110010110000100
01101000111110111100100000000000000000000000000000
00001000111110111100100101110101000110010110000100
00000000000000111100100000000000000000000000000100
00001101111110000000000101110101000000000110001100
00000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000
100 120
6 4 87 112
0000000001100000000000000000000000000000001111000000000000000000000000000000000000000000000000000000
0000000000000000000000000011111111111111101111000001111111110001111010100101111011001110111111101100
0110101101101111110011101011111111111111100000000001111111110001111010100101111011001110111100000000
0110101101101111110011100011111111111111101000000000000000000001111010100101111011001110111101101100
0110101100000000000001101111111111111111101000000000000000000000111010000000000000000000000000000000
0110101111101111110001101111111111111000000000000011111111100000111010100101111111001110111101100000
0110101111101111110000000000000000000001111111000011111111100000111000100101111111001110111101101100
0110101111101111110011101111111111100000000000000011111111000000000000000000000111001110111100001100
0110101111101111110011101111111111100101111100100011111000000000111100100101110111000000111101101100
0110101111101111110011101111111111100101111100100000000000000000000000000101110111101111111101101100
0110100000001111110011101111111111100101111100101011111011100000111100101101000111101111111101101100
0110100000000000000011101111111111100101111100101011111011100000111100101101011111101111111101101100
0110101111111111111011101111111110000101111100100001111011100000111100101101011111101111111101101100
0110101111111111111011101111111110110101111100111001111011100000110000000000011111101111111100000000
0110101111111111111011101111111110110101111000000000000000000000000000001101011111101111111101101100
0110101111111111111011101111111110000001111000111001111111100000000100001101011111101111111100000000
0000000000000000000000000001111111110111111000111001111111100000100100001101011111101111111111101100
0110101111110111111000000000000000000000001000000000000000000011100100001101011111101111111111101100
0110101111110111111111101101111111110000000000000001111111110000000000001101000000000000000000000000
0110101111110111111111101101111111110011101010111100000000000111100000000000011111101011111111100000
0110100011110111111111001101111111110011101010111111111111110111110100011111011111101011111111110000
0110111000000000000000001101111111110011101010111111111111110111110100011111011111101000000000000000
0110111111100111011111000001111111110011101010111111111111110111110100011111011111101111111111111100
0110111111100111011111001001111111110011101010111111111111110111110100011111011111101111111111111100
0110100000000000000000000001111111110011101010111111111111110000000000000000011111101111111111111100
0000000000000000000111001101111111100000000010111111111111110000000000011111111111101111111111111100
0110101111100000000000001101111111100011101110111111111111110111110100011111111111101111111111111100
0110101111101111010111011101111111100011101110111111111111110111110100011111111111101111111111111100
0000000000001111010111011101111111111011101110111111111111110111110100011111111111101111111111111100
0000000000000000000111011101111111111011101110001111111111110111110100011111111111101111111111111100
0010101111111111011111011101111111111011101110101111111111110000000100011111111111101111111111111100
0010101111111111011111011101111111111011101110101111111111111111111100011111111111101111111111111100
0010101111111111011111011101111111111011101110101111111111111111111100000001111111101111111111111100
0010101111111111011111011101111111111011101110101111111111111111111101111101111111101111111111111110
0000001111111111011111011101111111111000000000000000000000111111111101111101111111101111111111111110
0000000111111111011111011101111111111111111010101111111110111111111101111101111111101111111111111110
0010110000000000000000000001111111111111111000101111111110111111111101111101111111101111111111111110
0010110111111111011111000000000011111110000110101111111110111111111101111101111111101111111111111110
0000000111111111011111111101111011111110110110101111111110111111111101111100000011101111111111111110
0010110111111111011111111101111011111110110110101111111110111111111101111111111000001111111111111110
0010000000000001011111111101111011111110100000101111111110111111111101111111111111111111111111111110
0000000000000101011111111101111011111100000000101111111110111111111101111111111111111111111111111110
0000000011110101000000000000000000000000000000000001111110111111111101111111111111111111111111111111
0011000011110101111111111101111011111100100000000000000000000000000001111111111111111111111111111111
0011000011110101111111111101111000000000001110101101111110111111111111111111111111111111111111111111
0000000011110000000000000000000011111100001110101101111110111111111111111111111111111111111111111111
0000000000000000000000000000001011000000001110101101111110111111111111111111111111111111111111111111
0000000000000101111111111101101011011100000000000000000000000001111111111111111111110011111111111111
0011111011110101111111000000000000000100100000101101111110111101111111111111111111110011111111111111
0011111011110101111111011101101011010100111110101101111110111101111111111111111111110011111111111111
0000000001110101111111011101101011010100111110101000000000000000000000111111111111110011111111111111
0000000000000000011111011101000000000000111110101001111011111101111110111111111111110011111111111111
0010000011110101011111011101001011010010111110000000000011111000000000011111111111110011111111111111
0011111011110101011111011101001010000010111110100001110011111001111110000000000000000011111111111111
0001111011110101011111011101001010111110111110111101110011111001111110111111111111100011111111111111
0001111000000101011100000000000000000010111110111101110011111001111110111111111111100011111111111111
0000000000000000000000011001001010111010111110111101110011111001111110111111111111100011111111111111
0001111111111100000000000001001010111010000000000000110011111000000000000000000000000000000000011111
0001111111111111011100000000000000000000011110111100110011111011111110101111111111110011111111011111
0001111111111111011111111000000000000000000000000000000011111011111110101111111111110011111111011111
0111111111111111011110000000000010111010111111111100000000000000000000101111111111110011111111011111
0111111111111111011110111001000000111010111111111100000000000000000000001111111111000011111111011111
0111111110000000000000000001001100111010111111111100111011111011111111111111111111011011111111011111
0111111110111111011110111001001100000000000111111100111011111011111111111111111111011011111111011111
0000000000000000000000000001001101111010110111111100111011111011111111111111111111011011111111011111
0110000000000000000000000000001101111010110111111100111011111011111111111111111111011011111111011111
0110000000000000000000111101011101111010000000000000111011111011111111111111111111011011111111011111
0111111110111111011110111101011101111010010111111101111011111011111111111111111111011000111111011111
0111111110110000000000000000000000000000000001100001111011111011111111111111111111011110111111011111
0111111110000000001110101100000001111001110101101111111011111011111111111111111111011110111111011111
0111111110110111101110101101011001111001110100001111111011111011111111111111111111011110111111011111
0111111110110000000000000001011001111001110111111111111011111011111111111111111111011110111111000111
0111111110110011000000000000000000000000000000000011111011111011111111111111111111011110111111110111
0110000000000000001110000000000000000000000000011011111011111011111111111111111111011110111111110111
0110111110110110011110101101011001111001110111011011111011111011111111111111111111011110111111110111
0110111110110110011110101100000000011000000000011011111011111011111111111111111111011110111111110111
0110111110000000000000000000011001011001110110011011111011111011111111111111111111011110000000000000
0000000000000010011110101100011001011001110110011011111011111011111111111111111111011111111111110110
0010111111110010011110101100011001011001100000000000000000000000000000000000000000000000011111110110
0000000000000000000000000000000000000001100110011010111001111000111101111100000000000000011111110110
0010111111110000011100001100000000011101100110000000011001111110111101111101111111011111111111110110
0010111111110111011101111100111101111101100111000000000001111110111101111101111111011111111111110110
0000000000000001011101111100111101111101100111001001011101111110111101111101111111011111111111110110
0000000001110101011101111100111101111100000111001111011101111110111101111101111111011111111111110110
0010000000000001011101111100111101111111110111001111011101111110111101111101111111011111111111110110
0000011000000000000000000000000000000000000000000000000000000000111101111101111111011111111111110110
0000011001010111011101111100111101111111110111001111011101111110111101111101111111011111111111110000
0000011001010111011101111100111101111111110111001111011101111110111100011101111111011111111111111111
0000000000000000000001111100111101111111110111001111011101111110111111011101111111011111111111111111
0000011001110111011111111100111101111111110111001111011101111110111111011101111111011111111111111111
0000111001110111011111111100111101111111110000000000000000000000000000000001111111011111111111111111
0000111001110111011111111100111101111111111111011111111101111110111111011111111111011111111111111111
0000000000000000011111111100111101111111111111011111111101111110111111011111111111011111111111111111
0001111101111011111111111100111101111111111111011111111101111110111111011111111111011111111111111111
0000000000000011111111111111111101111111111111011111111101111110111111000000000000011111111111111111
0101111101111100000000111111111101111111111111011111111000000000111111111111111110011111111111111111
0101111101111101111110111111111101111111111111011111111000001111111111111111111110011111111111111111
0101111101111101111110111111111101111111111111011111111011101111111111111111111110000000001111111111
0101111101110000001110111111111101111111111111011111111011101111100000000000000000110000001111111111
0000000000000000000010111111111101111111111111011111111011101111101111111111111111110111111111111111
0101111111111101101010111111111101111111111111011111111011101111101111111111111111110111111111111111
0101111111111101101010111111111101111111111111011111111011101111101111111000000000000000000000000000
0000000111111101101010111111111101111111111111011111111011101111101111111011111111111101111111111110
0101110111111101100010111111111101111111111111011111111011100000001111111011111111111101111111111110
0101110111111101111000111111111101111111111111011111111011111111111111111011111111111101111111111110
0100000000000000000000111111111101111111111111010000111011111111111111111011111111111101111111111110
0100110111111101111010111111111100000000111111000000000011111111111111111011111111111101000000000000
0100110111111101111010111111111100111110111111110110111111111111111111111011111111111101011111110110
0100110111111101111010111111111100111110111111110110111111111111111111111011111111111101011111110110
0100110111111101111010111111111100111110111111110110111111111111111111111011111111111101011111110110
0100110111111101111010111111111100111110111111110110111111111111111111111011111111111101011111110110
0100110111111101111010111111111100111110111111110110111111111111111111111011111111111101011111110110
0000000111110000000010111111111100111110100000010110000000000111111111111011111111111101011111110110
0000000000000000111010000000000000000000000000000000000111110111111111111011111111111101011111110110
0111111111110100000000000011111100111110101111000000000000000000000000000011111111111101011111110110
0111111111110100011010111000000000000110101111110111110111110111111111111111111111111101011111110110
0111111111110100011010111111111100110110101111110111110111110111111111111111111111111101011111110110
0111111111110100011010000001111100110110001111110111110000110111111111111111111111111101011111110110
0111111111110100011010011101111100010111111111110111111110110111111111111111111111111101011111110110
0000000000000000000000000000000000000000000000000000011110000000000000000111111111111100000000000000
160 140
27 11 82 123
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000011100100000000000000000000000000000000000011101111111101110111111111011101111100111110001111011111100000000000000000000000000000110110111110100111110
0000000000000000000010100000001010110110110111000101011101111111101110111111111011101111100000000001111011111101111110111101110000011011100110110000010100111110
0101101100000000100010111111111000000110110100000001011101111111101110111111111011101111101111110101111011111101111110111101000000000000000000000000000000000000
0101101100011100100010000000000000000000000000000111011101111111101110111111111011101110000000000000011011100000000000011101010010111011100110001111000100111110
0100000000011100100010011111111010110100000101000111011101111111101110111111110000000000000000000000000011100000000000000000000000000000000000000000000000111110
0100100000011100100000001111111010100000000000000000000000000000000000111111110011111111100000000011011111111101110111011101010010110000000000001111111000111110
0100111100011100000100000000000000000000000000000000011101111111101000000000000011111111100111111011011111111101110111000000000000000000011011100000000000000000
0100111100011100000000001111111010100100110101000111111101111111101011111111110111111111100111111010000000000101110000000000000000000011111000000000000000111110
0100111100011100001100111111111010000100110101000111111000000000000000000000000111111111100111111010010001110101111111111101011111110111111111101111101010111110
0100111100011100001000000000000000000000000000000000000000000000000000000000000000000000000000000000010101110101111111111101011111110111111111101111101010111110
0000000000000000001000111111111010010100110000000000000001111111101011111111111111111111100111111010010101110101111111111101011111110111111111101111101010111110
0110111100000000001000111111111000000000000000000110111011111111101011111111111111111111100000000000010101110101111111111101011111110111111111101111101010111110
0110000000000000000000000000000000000101110101100000000000011111100011111111111111111111100001110101010101110101111111000001011111110111111111101111101010111110
0111111000011100101000111111110110011101110101100000111011011111111111111111111111111111101101110000000101110101111111011101011111110111111111100000000000000000
0000000000000000000000000000000000000001110101100111111011011111111111111111111111111111101101111111110000000101111111011100000000000000000000000111101010111110
0110111100001100101001111111001110011101110000000111111011000011111111111111111111111111101101111111100000000000011111011100011111110111111111000111101010111110
0000000000000000000000000000000000000000000101110111111011111011111111111111111111111111101101111111100000000000000000000000011111110111111110000000000000000000
0000000000000000001001111110001110001101110101110111111011111011111111111111111111111111101101111111101101111111010000000000000000000000000000000000000000001110
0000000000000000001001111100000000001101110101110111111011111011111111111111111111111111101101111111100000000000000000000000000000000000000000000000000000000000
0000110011011110101001111100001111001101110101110111111011111011111111111111111111111111101101111111100100000111010111010100001000000000000000000111101010101110
1110110011011110000000000000000000000001110100000001111011111011111111111111111111111111101101111111100111110111010111010100001000000000001110010111101010101110
0110110011001110001000000000000111001101110101110101111011111011111111111111111111110000000001111111100111110111010111010100001110110111101110010111101010101000
0110110011000000000000000000000001001101110101110101111011111011111111111111111111110001100000000000100111110111010111000000001110000000000010000001101010101010
0000000000000000000000000000000101001100000001110101111011111011111111111111111111111101111111111110100111110111010111110100011111110101100011000000000000000000
0110110011001100011010111010001101001101110001110101111011111011111111111111111111110000000011111110100001110111010111110100011111110101100011111101100000000000
0000000011001100011010111010000000001101110001110101111011111011111110000000000111110101111011111110110101110111010111110100000000000000000000000000000000000010
0110110111001100011010111010001101011101110001110101111011111011111110111111110111110000000000000000000000000000000000000000000000000000000000000000000000000000
0000010111001100011010111010001101011101110000000000000011111011111110111111110111111101111011100110110000010011011111110111000000000000000000000000001000000000
0000000000000000011010111010001101011101110001110101110011111011111110111111110111111100000000000110110101010011011111110111001111110101100001111000101000110010
0111010000000000000000000000000000011101110001110101110000000000000000111111110111111111111000001110110101010000000111110111001111110101100001111000101000110010
0111010011001001111000000000000000011101110001110101110111111011111100111111110111111111111111111110110001010111010111110111001111110101100001111000000000110010
0111010011001000000000000000001101011101110001110101110111111011111100111111110111111111111111111110110000000000000000000000000001110101100000000000000000000000
0000000000000000000000000000000000000001110001110101110111111011111100111111110100000000000000000110110001010111010111110111001101110101100000111000101000110000
0101000011111001111000111110100000000000000000000001110111111011111100111111110101111111111111110110110001010111010111110111000001110100000000000000000000110000
0100000000011000000000000000001100000000000101110111110111111000000000000000000101111111111111110110110001010111010111110111011001110100000000000000000000000000
0111000011011001111000001110000000111101110101110111110111111111111100111111110101111111111111110110110001010111010111110111011001110100000000000000000000000000
0000000011011001111000000111101110001101110101110111110111000000000000111111110101111111111110000110110000000111010111110111011001110000001010111010001000100000
0111000011011000000000100111101110101101110101110111110111011111111110111111110100111111111110111110110000000000000111110111011001111100000000000000000000000000
0000000000000000000000000011101110101101110000000000000000000000000000000000000000000000000000000000000000001111011111110111011000000000001010111010000000000010
0000000000000000111101100011101110101101111101110111111111011111111110110000000110111111111110111110111101001111011111110111011011111111111010111000000000000000
0100000011011010111101100011101110101101111101110111111111011111111110111111110110111111111110111110111101000000011111110111011011111111111010111000001000111010
0101100111011010111101100011101110101100000001110111111111011111111110111111110110111111111110111110111101011110011111110111011011111111111010111010101000111010
0101100111011010111101100011101110101111111111110111111111011111111110111111110010111111111110111110111101011100000000000000000000000000000010111010101000111010
0101100111011010111101100000000000001111111111110111111111011111111110111111110010111111111110111110000000000000011111110111000000000111111110111010000000000000
0101100000000010111101100000001110100000000000000000000000000000000000111111110010111111111110111110011101011110011111110111011011110111111110111010101000000010
0101101111011110111101100011111110000000000000000000000000000000111100111111110010111111111110111110011101011110000000000000000000010111111110111010100000011110
0101101111011110111101100011111100000000000000000111001011011100000000000000000010111111111110111110000001011111011111110111011000000001111110111010100000010000
0100101111011110111101100011111100101111111111110000001011011110111100111111110010111111111100000010111111011111011110000111011011010101111110111010000000010110
0110101111011110111101100011111100101111111111110101011011011110111100111111110010111111111100000000011111000000000000111111011011010101111110111011100000010110
0000001111011110111101100011111100101111111111110101011011011110111100111111110010111111111101111010011111000000011111111111011011010000000000000000000000010110
0110000000000000000000000000001100100001111111110100011011011110111100111111110000000000000000000000000000000011011111111111011011010001111110101011100000000000
0000001111011110111101110011101100111101100000000000011011011110111100111111111010111111111000000010001111100011000011111111011011010001111110101011100000010110
0111001111011110111101110011101100111101101111110000000000011110111100111111111010000111111001111110101111100011111011110000000000000001111110101011100000000000
0111000000011110111101110011100000000001101111110111011010011110110000111111111011110111111001111110101111100011111011110111011011111001111110101011100000010100
0111000111111110111101110011111100111001101111110111000000000000110100111111111011110111111001111110101111100011100000000000000001111001111110101011100000010100
0111100111111110111101110011111100111001101111110111011010011111110100111111111011110111111001111110101111100011101011110111011100000001110000000000000000000000
0000000000000000000000110011111100111001101111110111000000011111110100111111111011110111111001111110101111100011101000000000001100111001110110101000000000000000
1111101111111110111100110011111100111001101111110111011010111111110100111111111011110111111001111110101111100011101111110111001100000000000000001001100000010100
1111101111111110111100110000000100000000000000000000000010000111110100111111111011110111111001111110101111100011101111110111001100011001111111101001100000110110
1111101111111110111100000000000000011000000001110111010011110111110100111111111011110111111001111110101111100000000001110111001100011001111110001001100000110110
1111100000000010111110110111110110011110000000000000000000000111110100111111111011110111111001111110101111100111101101000111001100000000000000000001100000000000
1111111111111010111110000000000000000000000000000000000000000000000000111111111011110111100000000000000000000000000000000000000000000000000000000000000000000000
1111111111111010111110110000000000011111001101111111010011101111110100111111111011110111101001111110110111100111100000000000000000000000001110101001101011110100
1111111111111010111110110111110111011111001101111111000011000000000000111111111011110111101001111110110111100111111101011111011000111100111110001001101011110100
1111111111111000110000110111110111011111001101111111100011001111000000111111111011110111101001111110110111100111100000000000000000111100111110001001101011110100
1111111111111001110110110111110111011111001101111111100011001111010111111111111011110111101001111110110111100111101101011111011001111100111110001000000001110100
1111111111111001110110110111110111011111001101111111000000000000010111111111111011110111101000000000000000000111101101011111011001111100111110001011101001110100
1111111111111001110110110111110111011111001101111111000010000110010111111111111011110111101101111110110111100000000000000000011001100000000000001011101001110100
1111111111111001110110110111110111011110000000000000000010000110010111110000000000000000000000000110110111111111101101011100000001101100000000000000000000000000
0000000000000000000110110111110111011110000000000000000000000000000000000111111011110111101100100000000000111111101101011100010111101100111110001011101001111000
0111111111111001111110000111110111011100000001111111100000000000010111100111111000000000000000100110110110111111100000000000000000000000000000000000000000001000
0000000000000000001111111111110111011101011111111111000000000111010000000000111111110100000000000000000110111111111101011100010111101100111110001011100001101000
0000000001111001101111111111110111011101011111100000000000000000000011100110000001110101000000000000110000000000000000000000000000000000000000000000000000000000
0111111101000001101111111111110111011101011111101111000000000111011011100110111101110100000000000000000000000011111101011010010111101100111110001011100001001100
0111000000011101101111111111110111011101011111100001100000000111011011100110111101110111000000101111100010101011111101000000010111101100111111000011100000001100
0000001001111101101111111111110111011101011111111101100000000000000000000000000000000000000000001111110010101011111101111010010111100000000000001111100000000000
1111011001111101101111111111110111011101011111111101100000000000000000000000000000000000000000001111110010101000000000011010000000000000000000000000000000000000
1111000000000001101111111111110111011101011111111000000000010010000000000000000001110001011110101111110010101111111101011011010111111100111111001000000000000000
1111111111111111101111111111110111011101011111111001000000000011011000000110111101110000000000101111110010101111111100000001010111111100111111001011011001101000
1111111111111111101111111111110111011100000011111001000010011011011111100110111101110011011110101111110010100000000000000000010111111100111111001011011001101000
1111111111111111101111111111110111011000000011111001000010011011011111100110000000000000000000000000000000000000000000000000000000000000000000000000000000001000
1111111111111111101111111111110111011011011111111000000000000000000000000000000000110111000010101111111111101101111111111101110111111100111111001000000000001000
1111111111111111101111111110000001011011011111111000000000000000000000110100001100110111101010101100000000000001111111111101110111100000000000000000000000001000
1111111111111111101111111110110101011011011111111000000000000000000110110100101100110111100000001101111101111001111111111101110111101110111111101101111010000000
1111111111111111101111111100110101011011011111111000010010000000010000000000101100110111111010111101111101111001111111111101110111101110000000000000000000000000
1111111111111111101111111101110101011011011111111000000000011110011110110100100000000000000000000000111100000001111111111101110111101110111111101101110000000000
1111111111111111101111111000110000000001011111111001000000011110011110110100111100110111111010111100111100000000000000000000000000000000111111101101110010001000
1111111111111111101111111000000000000000000111111001000010011110011110100000111100110111111010111100111100011101101111111101110111111110111111101101110010001000
1111111111111111101111110000000000000000000000000000000010011110011110100000000000110111111010111100111100011101101111111101110000000000011111101101110010001000
1111111111111111101111110101000000000000110111111000000000000000000000110100111101110111110010111100000100011101101111111101110000000000000000000001110000000000
1111111111111111101111110101010001111010110000000000000000000000000001110000000000000111110110000000000100011101101111111101110001111110011110000001110000001100
1111111111111111100000000000000000000010110011111001001000000100000000000100111101100111110111111110111100000000000001111101110001111110011110101101110010101100
1111111111111111111111010101000001111010110011111000001110110100011101100100111101100111110111111110111100111101101100000000000000000000001110101101110010000000
1111111111111111111111010101000000000000000000000000000000000000000001100100111101100000000111111110111100111101101111111101101001111110001110101101110000000000
1111111111111111111111010101000001111000000011111000001110110110000000000100000000001111111111111110111100111101100000000000000000000000001110101101110110000110
1111111111111111111111010101000001111000000000000000000000010110000000000010111101111111111111100000000000111101100111111101101100111100001110101101110110000110
1111111111111111111111000001000000000000000000000000000000000000000000000010111101111111111111101110111000111101100111111100000000000000101110101101110110000110
1111111111111111111111110111000001100100110011110000000000000111001111100010111101111111111111100000000000000000000000000001101100111110101110101101110110000000
1111111000000000000000010111000001100000000011110000101011000000000011100000000000011111111111100010111110000000000000000000001100111110101110101101110110000111
1111111000000001111111000000011001100000000000000000000011110000000011100011011101011111111111101010111111111101100111111101111100000000000000000000000000000111
1111111111111101111111000000000000000000000000000000001011110000001111100011011101011111111111101000111111111101100111111101111101111110000000101100110000000000
1111111111111101111111000101111001101101101111110000111011111111011111100011011101011111111111101111111111111101100111111101111101111111101100101100000000001110
1111111111111100000000000000000000001101000000000000111011111111000111100011011101011111111111101111111111111101100111111101111101111111100000101100000000000000
0000000011111111100000000101111001101101010111110000111011111111110001100011011101011111111111101111111111111101100000000000000000000000000000000000000000000111
0111111011111111101111100101111001101101010111110000111011111111111101100111011100000000000000001111111111111001100011111000000001111111100000000000000000000011
0111111000000000000000000000000000000000010111110000111011111111111101100111011111011111111111001111111111111011100011111001111111111111110110101100110110110011
0111111111111111101111100000000001101000010111110000000000000000000001100111011111011111111111001111111111111011100011111000011111111111110110000000110110110011
0111111111111111101111110000000000000000000000000000111011111111111111100110000000000000000000001111111111111000000000000000000000000000110110001100000010110011
0111111111111111101111111101111011101010011111110001111011111111111111100110001111111111111111111111111111111111100111111011011111111110110110001101110010000011
0111111111111111101111111101111011101010011111110001111011111111111111100110101111111111111111111111111111111111000111111000000111111110110111101101110010111011
0111111111111111101111111100000000000000011111110001111011111111111111100110101111111111111111100000111111111111000111111111110111111110000110000000000000011011
0111111111111111101111111111111011101010111111110001111011111111111111100110000011111111111111101110111111111111000111111111110111111110000000000000000000000000
0111111111111111101111111111111011101000000000000001111011111111111111100111101011111111111111101110111111111111000111111111110111111110011110101111110110011010
0111111111111111101111111111111000000001111101111001111011111111111111100111101011111111111111101110111111111111000111111111100000000010011110101000000000000000
0111111111111111101111111111111111101001111100000001111011111111111000000000101011111111111111101110111111111111000111111111100111111000000000000000000000001010
0000000000000000000000000000000000000001111100011111111011111111111011000110100000000000000000000000000000000000000000000000000000000000111110100000000111001010
0111111111111111101111111111111111100000000000011111111011111111111000000000000000000000000000000000111111110110000111111111000111000000111110101011110111001010
0111111111111111101111111111111111101011111101011111111011111111111110110111110010101111111111101111111111110110000111111111000110000001111110101011110111001010
0111111111111111101111111000000011101011111101000000000000000000000000000111110000001111111111101110000000000000000000000000000000000000111110100011100000000010
0011111111111111101111111011111011101011111101111111111011111111111110111111110110111111111111101110111111000000000000000000100100010000000000000000000111000010
0011111111111111101111111011111011101011111101111111111011111111111110111111110110111111111111101110111000000011000111101110100100000000000000001011100111010110
0011111111111111101111111011111011101011111101111111111011111111111110111111110110111111111111101110111011111011000111101110100110111000111110101011100111010110
0011111111111111101111111011111011101010000001111111111011111111111110111111110110111111111111100000000011111000000111101110100110111000000000101011100111010110
0011111111111111101111111011111011101010111101111111111011111111111110111111110110111111111111111110111111111001100111100000000110111010111100000000000000000000
0011111111111111101111111011111011101010000001111111111000000111111110111111110110111111111111111110111111100000000111111110000110111010111101101011100111010110
0111111111111111101111111011111011101011110101111111111111110111111110111111110110111111111111111110111111101000000000000000000000000000000001101000000111010110
0111111111111111101111111011111000000000000000000000000000000111111110111111110110111111111111111110111111101100001111111110000110111010001111101011000111010110
0000001111111111101111111011111111100000000001111111111111110111111110111111110110111111111111111110000000000000000000000000000000011010001111101000000111000000
0111101111111111101111111011111111111011110111111111111100000111111110111111110110111111111111111111111111101111111111111111010110000000000000000000010000010111
0111101111111111101111111011111111111011110111111111111101110111111110111111110110111111111111111111111111101111111111111111010111011100001111101011111110010111
0111101111111111101111111011111111111011110111111111111101110111111110000000000000111111111111111111111111101111111111111111010111011100001111101011111110010111
0111101111111111101111111011111111111011110111111111111101110000000000111111110011111111111111111111111111101111111111111111010111011100001111101010011110010111
0111101111111111101111111011111111111011110111111111111101111111111110111100110011111111111111111111111111101111111111111111010111011100001111101010011110010100
0111101111111111101111111011111111111011110111111111111101111111111110111100110001111111111111111111111111101111111111111111010111011100001111101000010000010100
0111101111111111101111111011111111111011110111111111111101111111111110111100000001111111111111111111111111101111111111111111010100011111111110000010000110010100
0111101111111111101111111011111111111011110111111111111101111111111110111100110011111111111111110000000000001111111111111111010101111111111110101111111110010100
0111101111111111101111111011111111111011110111111111111101111111111110111100110011111111111111110111111111111111111111111111010101111111111110101111111110010000
0111101111111111100000000000001111111011110111111111111101111111111110111100110011111111100011110111100000000000000000000000000100000000000000101111111110010010
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111100000000000000000
180 180
4 5 96 168
000000000000000000000110000000000000000000000000000000000000000001111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
010110111011111011100000011111111110111111111111111100111110101101111111111111111111111000111011111111111001111111111111011011111111111111111111111111111111100111111111111111111110
010110111011111011101110111111111110111111111111111100000000000000000000000000000000000010111011111111111001111111111111011011111111111111111111111111100000000000111111111111111110
010110111011111011101110111111111110111111111111111110111110101101111111111111111111111110111011111111111001111111111111011011111111111111111111111111101111100110111111111111111110
000000000000000000000000111111111110111111111111111110111110101101111111111111111111111110111011111111111001111111111111011011111111111111111111111111101111100000111111111111111110
000000000010000000000000000011111110111111111110000000000000000001111111111111111111111110111011111111111001111111111111011011111111111111111111111111101111101111111111111111111110
010100101110000000001111111011111110111111111110111110111110101111111111111111111111111110111011111111111001111111111111011011111111111111111111111111101111101111111111111111111110
010000101111111011111111111011111110000111111110111110111110101111111111111111111111111110111011111111111001111111111111011011111111111111111111111111101111101111111111111111111110
000000000000011011111111100000000000000000000000000000000000001110000000000000000000000000000011111111111001111111111111011001111111111111111111111111101111101111111111111111111110
000000000000011011111111101000000000000000111100000000000000001110111111111111111111111110011111111111111001111111111111011101111111111111111111111111101111101111111111111111111110
000000001111011011111111101001101010010111111100110110111110101110111111111111111000000000011111111111111001111111111111011101111111111111111111111111101111101111111111111111111110
001000001111011011111111101101101010010111111100000000001110101110111111111111111011111111111111111111111001111111111111011101111111111111111111111111101111101111111111111111111110
000000000000011000000000000000000000000000000000110110101110101110111111000000000000000000001111111111111001111111111111011101110000011111111111111111101111101111111111111111111110
101100001100000000000000000000000000000000000000100110100000000010111111011111111011111111101111111111111001111111111111011101110111011111111111111111101111101111111111111111111110
101100001101011000001100000000000000000000000000100110101110101010111111011000000000001111101111111111111001111111111111011101110111011111111111111111101111101111111111111111111110
101100000001011000000000000000001011000000000000000110101110101010111111011011111011101111101111111111111001111111111111011101110111011111111111111111101111101111111111111111111110
101100101111011000001101010000000000000000000000000000001110100000000001011011111011101111101111111111111001111111111111011101110111011111111111111111101111101111111111111111111110
100000000000000000000000000000101000000011011110110110111110111010111101011011111011101111101111111111111001111111111111011101110111011111111111111111101111101111111111111111111110
111110101111111011001100000000000000000000000000110110111110111010000000000000000000001111101111111111111001111111111111011101110111011111111111111111101111101111111111111111111110
111110101111110000000000000000101000000110011101110110111110111011111111111011111011001111101111111111111001111111111111011100000000000000000000000000001111101111111111111111111110
111110101111110011001110000000000000000000000000000110111110111011111111111011111011001111101111111111111001111111100000000000000000011111111111111111111111101111111111111111111110
111110101111110011001110010110101101110110000000000000000000000011111111111011111011001111101111111111000000000000000000000000000111111111111111111111111111101111111111111111111110
110000000000000000000000000110101101110110000000000000000000000000000000001011111011001111101111000000011001111111100111011101111111111111111111111111111111101111111111111111111110
110110111111110111001100000000000000000000000000000110011111111011111111101011111011001111101111011111111001111111100111011101111111111111111111111111111111101111111111111111111110
110110111111110111000000000000000001110011001100100110011111111011111111101011111011000000000000001111111001111111100111011101111111111111111111111111111111101111111111111111111110
000000000000000000000001001010101101110011000000000110011111111011111111101000000011001111101111001111111001111111100111011101111111111111111111111111111111101111111111111111111110
010110111111110010111100000000001101110011000000100111111111111011111111101111110011000000000000001111111001111111100111011101111111111111111111111111111111101111111111111111111110
010110111111110000000000000000000001110011011101100111111111111011111111100000000000011111101111011111111001111100000000000101111111111111111111111111111111101111111111111111111110
010110111111110110111101000000111110000000011101100111111111110000111111111111110011011111101111011111111001111101100111010101111111111111111111111111111111101111111111111111111110
010110111111110110111101000000000000010011011101100111111111110010111111111111110011011111101111011111111001111101100111010101111111111111111111111111111111101111111111111111111110
000110111111110110111100000000000000000011000001100111111111110010111111111111110011011111101111011111111001111101100111010101111111111111111111111111111111101111111111111111111110
000110111111110110111101000000000000010111001001100111111111110010111111111111110011011111101111011111111001111101100000010101111111111111111111111111111111101111111111111111111000
000110111111110110000000000000000000000111001001100111110001110010111111111111110000011111101111011111111001111101101100000000000000000000001111111111111111101111111111111111111010
000110111111110110011101011001111111010110001001100111110101110010111111111111110111111111101111000000000011111101000001010101111111111111101111111111111111101111111111111111111010
000110111111110110011100011000000000000000001001100111110101110010111111111111110111111111101111111111111011111101001111010101111111111111101111111111111111101111111111111111111010
000110111111110110011101000000000000000000001001100111110101110010111111111111110111111111101111111111111011111101001111010101111111111111101111111111111111101111111111111111111010
001110111111110110011101000000000000000000001001100111110101110010111111111111110111111111100000000000000000000001001111010101111111111111101111111111111111101111111111111111111010
001110111111110110011101000000000000000000000001100111110101110010111111111111110111111111101111111111111011111111001111010101111111111111101111111111111111101100000000000000000000
001110111111110110011101000000000000000000101011100111110101110010111111111111110111111111101111111111111011111111001111010101111111111111101111111100000000000000000000000000000000
000000000000000000011101001101110000100010101011100111110101110000000000000111110111111111101111111111111011111111001111010101111111111111101111111101111111100001111011111100000000
001110000000000000000000000000110000000000000000000000000000000000111111110111110001111111101111111111111011111111001111010101111111111111101111111101111111111111111011111101110110
000011111111110100011100001100111000100000000011100111110101110011111111110111111101111111101111111111111011111111001111010000000000000000001111111101111111111111111011111101110110
001011111111110101011100000000000000101010101111100000000000000000000001110111111101111111101111111111111011111111001111000000111111111111111111111101111111111111111011111101110110
011011111111110101011100001100000000101010000011100011110111111111111101110000000001111111101111111111111011111111001111011100111111111111000001111101111111111111111000100000000110
000000000000000000000000001100111000000000000000000000110011111111111101111111000000000111101111111111111011111111111111011100111111111111011101111101111111111111000000000000000110
011011111111110000000000000000000000000011111011101010111011111111111101111111010000000000000000000000000000000000000000011100111111111111011101111101111111111111011010101101100110
011011111111110001111100000000000000000000000000000000000000011111111101111111010101100000000000000000000011111111110000111100111111111111011101111100000000000000000000000000000110
011011111111110001111100100000000000000000000011101010111010011111111101111111010101100000000000000000000000000111110110111100000000000000000001111111111111011111111011100100000000
000011111111111011111100111001011100101101110011101010000000011111111101111111010101100000000000000000110111110111110110111101111111111101011000000000000000000000000000000000100000
011111111111111011111100111001011100000000110011101011111011011111111101111111010100000000000000000000000111110111110110100001111111111101000000000000000000000000000000000000000000
011111111000000000000000000001011100101100110011101011111011011111111101111110000000111111101100111010111111110111110110101101111111111101111001111111111111111111111011110100110110
000000000000000000000000000001011100101100000000000000000000011001111100000110000000111111101100111000001111110000110110101100000000000001111001111111111111111111111000000000110110
011111111010111000000000000000000000000000111011101000000000000001111111110000010101111110000000001000101111111110110110101111111111111111111001111111111111111111111011110100110110
011111111010111111110111111101000000000000000000000000111011010001111111111111010101111110101101101000101111111110110110101111111111111111111001111111111111111111111011110100110110
000000000000000000000000000000000000000000000000001010111011010001111111111111010001111110101100000000000000000000110110000000000000000000000001111111111111111111111011110100000000
011111111010111111111100000000000000000000000000000000000000010001111111111111011111111110101111101000101111111100110110001111111111111111111011111111111111111111111011110101110110
011111111010111111111101110101011100101111111011011010111011000001111111111111011111111110101000000000101111111100110110001000000000000000000000000000000000000000011011110101110110
011111111010111111111101110101011100101111111011011010111011010011111111111111011111111110101011101001101111111000110110001011111111111111111011111111011111111110011011110101110110
011111111010111111111101110101011100101111111011011010111011010011111111111111011111111110101011101001101111111001110000000011111111111111111011111111011111111110011011110101110110
000000000000000000000000000101011100101111111011011010111011000011111111111111011111111110101011101000000000000000000000101111111111111111111011000011000111111110000000110101110000
011111111010111111101101110101000000101111111011011010111011111011111111111111011111111110101000000011101111111001111101101111111111111111111011011011000000000000000000000001110010
000000000000000000000001110101111100101111111011011010111011111011111111111111011111111100000000000000001111111001111101101111111111110000000000000000001111111110111010101001110010
011111111010111111101100000101111100101111111011011010100000000011111111111111011111111100101111000111001111111000000000000000111111110111111011000000001111111110111010101001110000
011111111010111111101101111101111100101111111011011010101011111111111111111111011000000000000000000000000011111011111101101110111111110111111011111011111111111110000000000000000000
011111111010111111101101111101111100101111111011011010100010000000000000000000000010000000101011000111001011111011111101101110111111110111111011111011111111111110111010101001110110
011111111010111111101101111101111100101111111011011010111010111111111111111111011110111100101011000111001011111011111101101110111111110111111011111011111111111110111010101001110110
011000000000000000000000000001111100000000000000000000000010111111111111111111011110111100101011000111000000000011111101101110111111110111111011111011100000000000111010101001110110
000000000000000000000000011111111110000000111001011010000000000000000000000000000000000000000001000111101011111011111101101110000000000000001011111011101111000000111010101001110110
000000000000111111111111111111111110000000000000000000000010111111111111111111000000111100100000000111101011111001111101101111111111110111101011111011101111011110111010101001110110
000000000000111111111111111111111000000000000001110010111110111111111111111111011100000000000000000000000000000001111000001111111111110111101011111000000001011110111010100000000000
001111111001111111111111111100000000000000000001110000111110111111111111111111011110111100101001100111101011111111111001111111111111110111101011111011101101011110111010100000010100
001111111000000000000000000000000000111101111111111010111110111111111111111111011110000000001000000000000011111111111001111111111111110111101011111011101101011110111010001001010100
001111111101111111111111111101111011111101111111111010111110111111111111111111011111111100111000000111101111111111111001111111111111110111101011111011101101011110111010111001010100
001111111101111111111111111101111011111100000000000000000000111111111111111111011111111100111011111111101111111111111001111111111111110111101011111011101101011110000000000000000000
000001110000000000111111111101111011111111111111111010111111111111111111111111011111111100000011111111101111111111111001111111111111110111101011111011101101011110111010111000000000
001101110101111110111111111101111011111111111111111010111111111111111111111111011111111111111011111111101111111111111001111111111111110111101011111011101101011110111010111000101110
000000110101111110111111111101110000111111111111111000000000000000000000000000000000000011111011111111101111111111111001111111111111110111101011111011101100011110111010111000101110
000000000001111110111111111101110010111111111111111010111111111111111111111111011111111011111011111111101111111111111001111111111111110111101011111011101111000000000000000000101110
011101111001111110111111111101110010111111111111111010111111111111111111000000000000000000000000000001101111111111111001111111111111110111101011111011101111011111111000111100101110
011101111001111110111111111101110010111111111111111010111111111111111111011111011111111011111011111101101111111111111001111111111111110111101011111011100000011111111000111100101110
000001111001111110111111111101110010111111111111111000111111111111111111011111011111111011111011111101101111111111111001111111111111110111101011111011100111011111111000111100000000
011111111001111110111111111101110010111111111111111011111111111111111111011111011111111011111011111101101111111111111001111111111111110111101011111011100111000000000000000000101110
011111111000000000111111111101110010111111111111111011111111111111111111011111011111111011111011111101101110000000111001111111111100000111101011111011100111011111111110111000100000
011111111101111111111111000000000010111111111111111011111111111111111111011111011111111011111011111101101110111110111001111111111101100111101000000000000000000000000000111000100111
011111111101111111111111011101110110111111111111111011111111111110000000000000000001000011111011000000000000000000000000000000000001100111101111111011100111011111111111111000100111
011111111101111111111111011101110110111111111111111010000000000000000000000000000000000011111011011011101110111110000000000000111111100111101111111011100111011111111111111000100111
011111111101111111111111011101110110111111111111111010111111111110111111011110111101011011111011011011101110111111111111111110111111110000001111111011100111011111111111000000000001
011111111101111111111111011101110110111111111111100000111111111110111111011110111101011011111011011011101110111111111111111110111111110111111111111011100111011111111111011000100101
000000000000001111111111011101110000111111111111101011111111111110111111011110111101011011111011000000000000000000000000001110111111110111111111111011100110000000000000000000000101
000000000000000000000001000000000000000000000000101011111111111110000000011110111101011011111011111011101110111111111111101110111111110111111111111000000000000000000000000000110101
000001111001111110111101001100000011111111111110101011111111111111111111111110111101011011111011111011101110111111111111101110111111110111111111111011100110011111111110011001110101
001111111001111110100000001111111011111111111110101011111111111111111111111110111101011011111011111011101110111111111111101110111111110111111111000000000110011111111110011000010101
001111111001111110101101001111111011111110000000000000000011111111111111111110111101011011111011111011101110111111111111101110111111110111111111011011110000011111111110011001010101
001111111001111110101101001111111011111110111110101011100011111111111111111110111101011011111011111011101110111111111111101110111111110111111111000000000000011111111110000001010101
001111111001111110101101001111111011111000111110101011100000000001111111111110111100011011111011111011101110111111111111100000000000000001111111001011111110011111111110001001010100
001111111001111110000000000000000000000000000000000000000000000000000000000000000001111011111011111011101110111111110000000000111111110101111111001011111110011111111110001001010110
001111111001000000000000001111111011111011111110101011111000000001111111111110111100111011111011111011101110111111110111111100111111110101111111001011111110011111111110001001010110
011111111000011111111111000000000000000000000000000000000011111111111111111110111110111000000000000011101110111111110111111100111111110101111111001011111110011111111110001001010110
000000011101011111111111001111111011111011111110101011111111111111111111111110111110111111111011111111101110111111110111111100111111110101111111001011111110011111110000000001010110
011111011101011000000000000000000000000000000000000000000000000000000000000000111110111111111011111111101110111111110111111100111111110101111111001011111110011111110110011011010110
011111011101011011111111001111111011111011111110101011111111111111111111111111111110111111111011111111101110111111110111111100111111110001111111001011111100000000000000000011010110
000000000000011011111111001111111011111011111110101011111111111111111111111111111110111111111011111101101110111111110111111100111111111111111111001011111100011111110110011111010110
001110000000011011111111001111111011111011111110101011111111111111111111111111111110111111111000000000001110111111110111111100111111111111111111001011111100000000110110000000010110
001110011101011011111111001111111011111000000000000011111111111111111111111111111110111111111111111101111110111111110111111100111111111111111111001011100110011110110110011111110110
001110011100011011111111001111111011111111111110101011111111111111111111111111111110110000000000000101111110111111110111111100111111111111111111001011100000011110110110011111110110
001110000000000000000000001111100011111111111110101011111111111111111111111111111110110111111111110101100000000000110111111100111111111111111111001011100011011110110110011111110110
001110111111011011111111001111101111111111111110101011111111111111111111111111111110110111111111110101101110111110110111111100111111111111111111001011100000001110110110000000110110
001110111111011011111111001111101111111111111100000000000000001111111111111111111000000000000000000101101110111110110000000000111111111111111111001011100111001110110110011110110110
000000000000000000000000001111101111111111111100101011111111101111111111111111111010110111111111100101101110111110110111111101111111111111111111001011100111000000000000000000000110
000000000000000000000000000000000000011111111100101011111111101111111111111111111000000000000000000000000000011110110111111101111111111111111111000011100111011110110110011110111110
001110111111000000000000000000101111011111111111101011111111101111111111111111111110110111111111100000000000000000000111111101111111111111111111011111100111011110110110011110111110
000000000000000000000000000000001111011111111111101011111111101111111111111111111110110111111111101100000000011110110111111101111111111111111111011111100111010000000000000000000000
001110111111001110111101111000000000000011111111101011111111101111111000000000000110110111111111101101100000000110110111111101111111111110000000000000000111010110110110011110111110
000000000000000000000000000000000000011011111111101011111111101111111011111111110110110111111111101101111111110110110111111101111111111110111111011111110111010110110110011110111110
001110111111001110111101111001001111000011111111101011111111101111111011111111110110110111111111101101111111110110000111111101111111111110111111011111110111010000000000011110111110
001110111111000000111101111001001111011111111111101011111111101111111011111111110110110111111000000101111111110111111111111101111111111110111111011111110111011110110110011110111110
001110111111000110000001111000001111011111111111101011111111101111111011111111110110110111111011100101111111110111111111111101111111111110111100011111110111011110110110011110110000
000000111111000110111100000000011111011111100000000011111111101111100000000111110110110111111011100101111111110111100000000000001111111110111101111111110111011110110110000000000000
000011111111000110111101111101111111011111101111101011111111101111101011110111110110110111111011100101111111110111101111111100101111111110111101111111110111011110110111011110110110
000011111111000110111101111101111111011111101111101011111111101111101011110111110110110111111011100101111111110111101111111110001111111110111101111111110111011110110111011110110110
000011111100000110111001111101111111011111101000001011111111101111101011110111110110000111111011100001111111110111101111110000001111111110000001111111110111011110110111011110110110
010111111000000000111001111101111111011111101011101011111111101111101011110111110000000111111011110111111111110111101111110110101111111110011101111111110111011110110111011110110110
010111111001001111111001111101111111011111101011100000000000000000000001110111111110000000000000000000000000000000000000110110101111111110000000001111110111011110110110011110000000
010111111001011111111001111101111111011111101011001011111111111111100001110111100000000011111011111111111111110011101110110110101111111111011101101111110111011110000110011111110010
010111111001011111111001111101111111011111101011001011111111111111100001110111101100110011111011111111111111110011100000000110101111111111011100000000000011011110111110011111111000
010111111001011111111001111101111111011111101011000011111111111111100001110111101100110011111011111111111111110000000000000000000000000000000000001111110000000000000010011111111000
010111111001011111111001111101111111011111101011101111111111111111000001110111101100110011111011111111111111110011100000000000000000000000000001001111110000011100111010011111111000
010111111001011111111000000001111111011111101011101111111111111111010001110000000000000011111011111111111111110011110111110110111111111011101111001111111111111100000000011111111000
010111111001011111111001111111111111000011101011101111111111111111010001111111101100110111111011111111111111110011110111110110000000000000001111001111111111111101111011011111111000
010111111001011111111001111111111111111011101011101111111111111100000001111111101100110111111011111111111111110011110111110111111111111011111111001111111111111101111011011111111010
010110000000000000000001111111111111100000001011101111111111111101010101111111101100110111111011111111111111110011110111110111100000000011111111001111111111111101111011011111111010
010110111011011111110000001111000000000000000011100000000000000000000100000000000000000111111011111111111111110011110111110100000000000001111111000000000000000000011011011111111010
000000111011011111110001101111010011101011101111101111111111111101011111111111100000111111111011111111111111110011110110000001101111111101000000001111111111111101011011011111111010
000000000000010000000000000000010011101011101111101111111111111101010001111111111011111111111011111110000000000000000000000011101111111101011111001111111111111101011011011111111010
000000110001110111110001101111010011101011101111101111111111111101010101111110000000000000000000000000110000000000000000000000001111111101000000001111111111111101011011011111111010
100111110001110111110001101111010000000001101111101111111111111101010000000000001011111111111011111111110011010111110111110011111111111101111111101111111111111101011011011111111010
000111110001110111110000000000000000000001101111101100001111111101010101111110001000000000000000000000010011010111110111110011111100000001111111101111111111111101011011011111111010
010111110001110111110001101111010111101101101111101101101111111101010101111111111011111111111011111111010011010111110111110011111101111111111111101111111111111101011011011111111010
010111110001110111110001100000000000000000000000000000000000000101010101111111111011111111111011111111010011000011110000000000000001111111111111101111111111111101011011011111111000
010111110001110111110001111101010101101101101101101101011111110101010101111111111011111111111011111111010011010011111111110011111111111111111111101111111111111101011001011111100010
010111110000000111110001000000010000000001101101101101000001110101010101111111111011111111111011111111010011010011111111110011111111111111111111100000000000000000000000000000000000
010111111001111111110001011101011101101111101101101101111101110001010101111111111011111111111011111111010011010011111111110011111111111111111111111111111111111101011101111111101110
010111111001111111110001011001011101101111101101101101100101111001010101111100000001111111111011111111010011010000000000000011111111111111111111111111111111111101011101111111101110
000000000001111111110001011001011101101111101000001101100100000000000000000001111001111111111011100000000000000000000000000011111111111111111111111111111111111101011101111111101110
010111111101111111110001011001011101101111100000000001100111111001010101111111111001111111111011101111010111010111111111110111111111111111111111111111111111111101011101111111101110
010111100000000000000001011001011101101111111001111111100111111001010000001111111000000000000000000000000000010111111111110111111111111111111111111111111111111101011101111111100010
010000001101111111110001011001011101101111111000000000000000000000000001101111111001111111111011101111010111110111111111110111111111111111111111111111111111111101000000000000000000
011111111101111111110000000001000000000110000011111111101101111001010001101111111001111111111011101111010111110111111111110111111111111111111111111111111111111101111101111111111010
011111111101111111110101010001011101100110111011111111101101111001010001101111111001111111111011101111000000000000000000000111111111111111111111111111111111111100000000000001111010
011111111101111111110101010001011101100110111000000000000000000000000000000000000000000011111011101111110111110111111111110000000000000000000011111111111111111111111101111101111010
000000000000000000000000000000000000000110111011111111101101111001010100101111111001111011111011101111110111110111111111110111101110111111111011111111111111111111111101111101111010
011111111101111111111101110000000001111110111011111111101101111001010100101111111001111011111011101111110111110111111111110111101110111111111011111111111111111110000000000000000010
000000000001111111111101110001011111111110001011111111101101111000000100100000000000000000000000001111110111110111111111110111101110111111111011100000000000000000011101111101110010
011111111111111111111101110001011111111111101011111111101101111001011100100111111001111011111011111111110111110111111111110111101110111111111011101111111111111101000000000000000000
011111111111111111111100000000000000000000000000000001101101111001011100100111111001111011111011111111110111110111111111110111101110001111111011100000001111111101111101111110000000
011111111111111111111111110000000000000000001011111101101101111001011100100111111001111000000000000000000001110111111111110111100000001111111011111100000111111101111101111111110010
011111111111111111111111110101011011111111111011111101101101111001011100100111111001111111101111111000000101110111111111110111111111111111111011111101100111111101111101111111110010
011111111111111111111111110101011011111111111011111101101101000000000000000011111001111111101111111011111101110111111111110111111111111111111011111101100111111101111101111111110010
011100000111111111111111110101011011111111111011111101101101011000000000000000000001111111101111111011111101110111111111110111110000000000001011111101100111111101111101111111110010
011101110111110000111111110000011011111111111011111101101101011001011100100011111101111111101111111011111101110111111111110111110111111111101011111101100111111101111101111111111110
011101110111110000000000111101111011111100000000000000001101011000000000000011111101111111101111111011111101110111111111110111110000000000000011111101100111111101111101111111111110
011101110111110010111110111101111011111101111011111101111101000001011100110011111101111111101111111011111101110111111111110000000000000111101111111101100000000000000000000000000000
011101110111110010111110111101111011111101111011111101111101111111011100110011111101111111101111111011111101110111111111110011110111110000000000000000000000000000000000000000111110
011101110111110010111110111101111011111101111011111101111101111111011100110011111101111111101111111011111101110111111111110011110111111111101111111101101111111101111101111110111110
000001110111110000000000000001111011111101111000000000000000000000000000110011111101111111101111111011111101110111111111110011110111111111101111000001101111111101111101111110111110
111001110111111010111110111101111000001101111001111101111001111111111100110001111101110001101111111011111101110111111111110011110111111111101000000000000000000000111101111110111110
111001110110000000000000000000001011101101111001111101111011111111111100111001111101110101100111111011111100000011111111110011110111111000000000011111111100000000111101111110111110
100000000000000000000000000000000000001101111001111101111011111111111100111001000000000000000000000000000000000000000000000000000111111011101011111111111111111101110000000000111110
101010111110111010111110011101101011111101111000000001111011111111111100111001011111111101111111111111111111110011111111110011110111111011100000111111111111111101110101111111111110
101010111110000000000000000001101011111101111100000000000011111111111100111001011111111101111111111111111110000000000000000000000111111011111010111111111111111101110101111111111110
100000000000000000000000000000000000011101111111111111111111111111111100000000001111111101111111111111111110110011111111110011110111111011111010111111111111111101110000000111111110
000010111111111010111110000000000011011101111111111111111111111111111100111111001111111101111111111111111110110011111111110011110111111011111010111111111111111101111100000000000000
011110111111111010111110011111101011011100000000011111111111111111111100111111001111111101111111111111111110000011111111110011110111100000000000000000000000001101111111100111111100
011110111111111010111110011111101011011111111111011111111111111111111100111111001111111101111111111111111111110111111111110011110111101011111000111111101111101101111111101111111100
011110111111111000000000000000101011011111111111011111111111111111111100111111001111111101111111111111111100110111111111111111110111101011111000110000000000000000000000000000000000
011110111111100000000000000000000000011111111111011111111111111111111100111111001111111101111111111111111100110111111111111111110111101011100000000000001111101101111111101111111100
011110111111101010111110010110101001111111111111011111111111111111111100000000001111111101111111111111110000110111111111111111110111100000001110110111111111101101111111101111111100
011110111111101010111110010110101001111111111111011111111111111111111101111111101111111101111111111111110110110111111000000000000000000000000000000100000011101101111111101111111100
011110111111101010111110010000101001111111111111011111111111111111111101111111101111111101111111111111110110110111111011111110000111111011011111111101111011101101111111101111111100
000000000000000000000000000000000001111111111111000000000000000000000000000000000000000001111111111111110000000000000000000000000000000000000000000000000011100001111111100000000000
200 200
2 2 114 199
11111111111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
10000000000000000000000000000000000000000000011111110111111111111111111111111111111111111111111111111101111111111111111111111111111111111111111111111111111111111101111111111111111111111111111111111111
10111111111111111110111111111111111111111111011111110111111111111111111111111110000000000000000000000001111111111111111111111111111111101111111111111111111111111111111111111111111111111111111111111111
11111111111111111110111111111111111111111111011111110111111111111111111111111110111111111111111111111101111111111111111111111111111111100000000000000001111111111111111111111111111111111111111111111111
11111111111111111110111111111111111000000000011111110111111111111111111111111110111111111111111111111101111111111111111111111111111111101111111111111101111111111111111111111111111111111111111111111111
11111111111111111110111111111111111011110111111111110111111111111111111111000000111111111111111111111101111111111111111111111111111111101111111111111101111111111111111111111111111111111111111111111111
11111111111111111110111111111111111011110111111111110111111111100000000000011110111111111111111111111101111111111111111111111111111111101111111111111100000000000000000000000000000111111111111111111111
11111111100000000000111111111111111011110111111111110111111111101111111111111111111111111111111111111101111111111111111111111111111111101111111111111101111111111111111111111111110111111111111111111111
11111111101111111111111111110000000000000000001111110111111111101111111111111111111111111111111111111101111111111111111111111111111111101111111111111101111111111111111111111111110111111111111111111111
11111111101111111111111111110111111011111111101111110111111111101111111111111111111111111111111111111101111111111111111111111111111111100000000000000001111111111111111111111111110111111111111111111111
11111111101111111111111111110111111011111111101111110111111111101111111111111111111111111111111111111101111111111111111111111111111111101111111111111111111111111111111111111111110111111111111111111111
11111111101111111111111111110111111011111111101111110111111111101111111111111111111111111111111111111101111111111111111111111111111111101111111111111111111111111111111111111111110111111111111111111111
11111111101111111111111111110111111011111111101111110111111111101111111111111111111111111111000000000001111111111111111111111111111111101111111111111111111111111111111111111111110111111111111111111111
11111111101111111111111111110000000000000000001111110111111111101111111111111111111111111111011111111101111111111111111111111111111111101111111111111111111111111111111111111111110111111111111111111111
11111111101111111111111111111111111111111011111111110111111111101111111111111111111111111111011111111101111111111111111111111111111111101111111111111111111111111100000000000000000111111111111111111111
11111111001111111111111111111111111111111000000000000111111111101111111111111111110000000000011111111100011111111111111111111111111111101111111111111111111111111101111111110111111111111111111111111111
11111111101111111111111111111111111111111111111111111111111111101111111111111111110000111111111111111111011111111111111111111111111111101111111111111111111111111101111111110111111111111111111111111111
11111111101111111111111111111111111111111111111111111111111111101111111111111111111110111111111111111111011111111111111111111111000000000000000011111111111111111100000000000000011111111111111111111111
11111111100000011111111111111111111111111111111111111111111111101111111111111111111110111111111111111111000000001111111111111111000000000000000011111111111111111111101111110111011111111111111111111111
11111111111101011111111111111111111111111111111111111111111111101111111111111111111110111111111111111111000000000111111111111111011111111111111111111111111111111111101111110000011111111111111111111111
11111111111101000000000000000000000001111000000000111111111111101111111111111111111110111111111111111111000000000111111111111111011111111111111111111111111111111111101111111101111111111111111111111111
11111111111101111111111111111111111100000011111110000000000000001111111111110000000000111111111111111111000000000000011111111111011111111111111111111111111111111111100000000001111111111111111111111111
11111111111101111111111111111111111101111111111110111111111111111111111111110000000000111111111111111111110111111111111111111111011111111111111111111111111111111111111110111111111111111111111111111111
11111111111101111111111111111111111100000000000000111111111111111111111111110000000000111111111111111111110111111111111111111111011111111111111111111111111111111111111110111111111111111111111111111111
11111111111101111111111111111111111111111111111111111111111111111111111111110000000000111111111111111111110111111111110000000000011111111111111111111111111111111111111110111111111111111111111111111111
11111111111101111111111111111111111111111111111111111111111111111111111111111110111111111111111111111111110111111111110111111111111111111111111111111111111111111111111110000000000000000000000000011111
11111111111101111111111111111111111111111111111111111111111111111111111111111110000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111101111111001111
11000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111011111111111111111111111111111111111111111111111111111111111111111111111111101111111101111
11111111111101111111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111101111111101111
11111111111101111111111111111111111111111111111111111111111111111101111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000000001111
11111111111101111111111111111111111111111111111111111111100000001101111111111111111111111111111111111111111111111111111111111111111111111111111111111110000000000000000000000000000011111111111111101111
11111111111101111111111111111111111111111111111111111111101111101101111111111111111111111111000000000000000000000000111111111111111111111111111111111110111111111111111111111111111000000000000000001111
11111111111101111111111111111111111111111111111111111111101111101101111111111111111111111111011111111111111111111000111111111111111111111111111111111110111111111111111111111111111111111111111111111111
11111111111100000000000000000000000000000000000000000000001111100001111111111000001111111111011111111111111111111011111111111111111111111111111111111110111111111111111111110000000000000001111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111011100000011111011111111111110001111000000001111111111111111111111111111110111111111111111111110111111111111101111111111111
11111111111111111111111111111111111111111111111111111111111000000000111111111011110111000000011111111111110101111111111101111111111111111111111111111110111111111111111111110111111100011101110000111111
11111111111111111111111111111111111111111111111111111111111111111110111111111011110111011111111111111111110101111000000001111111111111111111111111111110111111111111111111110111111101011101110110100011
11111111111111111111111111111111111111111111111111111111111111111110111111111011110000011111111111111111000101111011111111111111111111111111111111111110000000000000000000000000000001011101110110101001
11111111111111111111111111111111111111111111111111111111111111111110000000000011111111111111111111111111011101111000000000000011111111111111111111111111111111111111111111111111111111011101110110001101
00000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111011101111111111111111011111111111111111111111111111111111111111111111111111111011101110111111101
10111111111101011111110111101111111111111111111111111111111111111110111111111111111111110000000000000000011101111000000000000011111111111111111111111111111111111111111111111111111111000000000111111101
10111111111101011111110111101111111111111111111111111111111111111110111111111111111111110111111111111011111101111011111111111111111111111111111111111111111110000000011111111111111111111111111111111101
00111111111100000000000111101111100000011111111111111111111111111110111111111111111111110111111111111011111101111011111111111111111111111111111111111111111110111111011111111111111111111111111111111101
01111111111101011111111111101111101111011111111111111111111111111110000001111111111111110111111111111011111101111011111111000000000000000000000000000111111110111111011111111111111111111111111111111100
01111111111101011111111111100000001111011111111111111111111111111111111101111111111111110111111111111011111101111011111111011111111111111111111111110111111110000000000000000111111000000000000000000010
01111111111101011111111111100000001111011111111111111111111111111111111101111111111111110000001111111011111101111011111111011111111111100011111111110111111111110111111111110000000000000000000000000000
01111111111101011111111111111111101111011111111111111111111111111111111101111111111111111111101111111011111101111011111111000000000000001011111111110111111111110111111111111111111111111111111111111111
01111111111100000000111111111111101111011111111111111111111111111111111101111111111111111111101111111011111101111011110001111101111111111011111111110011111111110000000000000000111111111111111111111111
01111111111111111110111111111111101111011111111111111111111111111111111101111111111111111111101111111011111101111011110101111101111111111011111111111001111111111111111111111110111111111111111111111111
01111111111111111110000000000011101111011111111111111111111111111111111101111111110000000000001111111011111101111000000101111101111111111000000001111100111111111111111111111110111111111111111111111111
00000000000000000000111110111011111111011111111111111111111111111111111101111111110111111111101111111011111101111111111101111101111111111111111101111110011111111111111111111110111111111111111111111111
01111111101111111111111110111011111111011111111111111111111111111111111101111111110111111111101111111011111101111111111101111101111111111111111101111111001111111111000000000000111111111111111111111111
00000011101111111111111110111000000000011111111111111111111111111111111101111111110111111111101111111011111101000000000000000001111111111111111101111111100111111111011111111111111111111111111111111111
11111000001111111111111110111111111111111111111111111111111111111111111101111111110111111111100000000011111100011111111111111101111111111111111101111111110011111111011111110000000000000111111111111111
11111111011111111111111110111111111111111111111111111111111111111111111101111111110111111111111111111111111111111111111111111101111111111111111100000000000000000000011111110111111111110111111111111111
11111111011111111111000000111111111111111111111111111111111111111111111100000000000111111111111111111111111111111111111111111101111111111111111111111111111111111111111111110111111111110111111111111111
11111111011111111111011100111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101111111111111111111111111111111111100000000000000000011110111111111111111
11111111000000000000000001111111111111111111111111110000000000000111111111111111111111111111111111111111111111111111111111111100000000111111111111111111111111111101111111110111111011110111111111111111
11111111111111111111110111111111111111111111111111110111111111110111111111111111111111111111111111111111111111111111111111111111111110111111111111111111111111111101111111110111111011110111111111111111
11111111111111111111110111111111111111111111111111110111111100000111111111111111111111111111111111111111111111111111111111111111111110001111111111111111111111111101111111110111111011110000001111111111
11111111111111111111110111111111111111111111111111110111110000000000111111111111111111111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000000011110111101111111111
11111111111111111111110111111111111111111111111111110100010101111110111111111111111111111111111111111111111111111111111111111111111111101111111111111111111111111101111111110111111111110111101111111111
11111111111111100000000000000000000001111111111111110001000101111110000000000001111111111111111111111111111111111111111111111111111111101111111111111111111111111101111111110000000000000111101111111111
11111111111111101111110111111111110111111111111111110111100101111110111111111101111111000000000001111111111111111111111111111111111111101111111111100000000011111100000000000111111111111111101111111111
11111111111111101111110111111111110111111111111111110111110101000000111111111100000000011111111100000111111111111111111111111111111111101111111111101111111011111111111111111111111111111111101111111111
11111111111111100000000000000000000111111111111111110111110000011111111111111101111111111111100001110111111111111111111111111111111111101111110000000011111011111111111111111111111111111111101111111111
11111111111111101111110111111111111111111111111111110111111101100001111111111101111111111111101111110111111111111111111111111111111111101111110111111011111000000000001111111100011111111111101111111111
11111111111111101111110111111111111111111111111111110111111100001100000000000001111111111111101111110111111111111111111111111111111111101111110111111011111111111111101111111101000000000000001111111111
11111111111111100000010111111111111111111111111111110111111111111111111111111111111111111111101111110111111111111111111111111111111111100000000111111011111111111111100000000001110111111111111111111111
11111111111111111111000111111111111111111111111111110111111111111111111111111111111111111111101111110111111111111111111111111111111111111111111111111011111111111111111111110111110111111111111111111111
11111111111111111111101111111111111111111111111111110111111111111111111111111111111111111111101111110111111111111111111111111111111111111111111111111011111111111111111111110000000111111111111111111111
11111111111111111111101111111111111111111111110000110111111111111111111111111111111111111111101111110111111111111111111111111111111111111111111111111011111111111111111111111111111111111111111111111111
11111111111111111111101111111111111111111111110110110111111111111111111111111111111111111111101111110111111111111111100000011111111111111111111111111000000000000000111111111111111100000000000000000000
11110000000000011111101111111111111111111110000110000111111111111111111111111111111111111111101111110111111111111111101111000111111111111111111111111011111111111110000000000000000001111111111011111110
11110111111111011111101111111111111111111110111111111111111111111111111111111111111111111111101111110111111111111111100001110000000011110000000001111011111111111111111111111111111111111111111011111110
11110111111111000000001111111111111111111110111111111111111111111111111111111111111111111111101111110111111111111111111101110111111011110111111101111011111111111111111111111111111111111111111001111110
11110000000000000001111110000000000000000000111111111111111111111110111111111111111111111111101111110111111111111111111101110111111011110111111101111011111111000000000000111111111111111111111101111110
11111111111111101111111110111111111111111111111111111111111111111111111111111111111111111111101111110111111111111100000001110111111011110111111101111011111111011111111110111111111111111111110000000000
11111111111111100000000000111111111111111111111111111111111111111111111111111111111111111111101111110000000000111101111111110000011011110111111101111011111111011111111110111111111111111111110111111111
11111111111111111111111111111111100000000000000000000000000000000000000000000000011111111111101111110111111110111101111111111111000011110111111100000011111111011111100000000000000000000000000111111111
11111111111111111111111111111111101111111111111111111111111101111111111111111111011111111111101111110000000000111101111111111110011111000111111111111111111111011111101110111111111110111111111111111111
11111111111111111111111111111111101111111111111111111111111001111111111111111111011111111111101111110111111110111101111111111110000000010111111111111111111111001111101110111111111110111111111111111111
11111111111111000000000000000000001111111111111111111111111011111111111111111111011111111111101111110000000000111101111111111111111111000111111111111111111111101111101110000000000110111111111111111111
11111111111111011111111111111111111111111111111111111111111001111111111111111111011111111111101111110111111110111100000000000000000000011111111111111111111111101111101110111111110110111111111111111111
11111111111111011111111111111111111111111111111111111111111101111111111111111111011111111111101111110000000000111111111111111111111111111111111111111111111111101111100000111111110110111111111111111111
11111111111111011111111111111111111111111111111111111111111101111111111111111111011111111111101111110111111110111111111111111111111111111111111111111111111111101111101111111111110000111111111111111111
11111111111111011111111111111111111111111111111111111111111100011111111111111111011111100000001111110000000000111111111111111111111000000000000011111111111111100000001111111111110111111111111111111111
11111111111111011111111111111111111111111111111111111111111111011111111111111111011111101111111111110111111111111111111111111111111011111111101000011111111111111000001111111111110111111111111111111111
11111111111111000000000000000000000000000000000000000000000000011111111111111111000000001111111111110111111111111111111111111111111011111111101111011111111111111101111111100000000000011111111111100011
11111111111111111111111101111111111111111111111111111111111111111111111111111111111111111111111111110111111111111111111111110001111011111111100001000000000000000001111111111111111111011111111111101011
11111111111111111111111101111111111111111111111111111111111111111111111111111111111111111111111111110111111111111111111111110100000011111111000111111111111111111111111111111111111111011111111111101001
11111111111111111111111101111111111111111111111111111111111111111111111001110001111111111111111111110111111111111111111111110001111111111100011111111111111111111111111111111111111111000000000000001101
11111111111111111111111101111111111111111111111111111111111111111110000001000100000001111111111111110111111111111111111111111011111111110001011111111111111111111111111111111111111111111111111111111101
11111111111111111111111101111111111111111111111111111111111111111110111001000111111101111111111111110111111111111111111111111011111111000111011111111111111111111111111100000000000000111100000000000001
11111111111111111111111101111111111111111111111111111111111111111110111100001111111101111111111111110111111111111111111111111011111111011111011111111111111111111111111101111111111110011101110111111111
11111111111111111111111101111111111111111111111111111111111111111110111111111111111101111111111111110111111111111111111111111000000000011111011111111111111111111111111101111111111111000000000111111111
11111110000000000000000001111111111111111111111111111111111111111110111111111111111101111111111111110111111111111111111111111111111111111111011111111111111111111111111101111111111111110111111111111111
11111110000000000000011111111111111111111111111111111111000000000000000111111111111101111111111111110111111111111111111111111111111111111111011111111111111111111111111101111111111111110111111111111111
11111111111110111111111111110000000000000000000000000000011111111111110111111111111101111111111111110111111111111111111111111111111111110000011111111111111111111111111101111111111111110000000011111111
11111111111110111111111111110111111111111111111110111111111111111111110011111111000000001111111111110111111111111111111111111111111111110111111111111111111111111111111101111111111111111111111011111111
11111111111110111111111111110111111111111111111110111111111111111111111001111111011101101111111111110000000000000000000000111111111111110000000000000001111111111111111101111111111111111111111011111111
11111111111110111111111111110111100000000000000000000001111111111111111100000000011101101111111111111111111111111111111110011111111111110000000000000001111111111111111101111111111111111111111011111111
11111111111110000000000000000111101111111111000001111101111111111000111111111111111101101111111111111111111111111111111111011111111111111110111111111111111111111111111101111111111111111111100011111111
11111111111111111111111111111111101111000000011111111101111111111010111111111111111101101111111111111111111111111111111111000000000000000000111111111111111111111111111100011111111111111111001111111111
11111111111111111111110000000000001111011111111111111100000000000010111111111111111101101111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000011111111111
11111111111111111000000000011111111111011111111111111111111111111110000000000000000000001111111111111111111111111111111111111111111111111111111111111111111110000001111111111111101111111111111110000000
11111111111111100011111111011111111000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101111111111111110111101111111111111101111111111111110000010
11111111111111101011111111000000000011111111111111111111111111111111111111111111111111111111111111111110000111111111111111111111111111111111101111111111111110111101111111110000001111111111111111111010
11111111111111100011111111111111111111111111111111111111111111111111111111111111111111111111111111111110110111111111111111111111111111111111101111111111111110111100000000000011001111111111111111110000
11111111111000000111111111111111111111111111111111111111111111111111111111111111111111111110000000011110110111111111111111111111111111111111101111111111111110111111111111111111100000000000000000000111
11111111111011111111111111111111111111111111111111111111111111111111111111111111111111111110111111000000110111111111111111111111111111111111101111111111111110111111111111111111111111111111111111111111
11111111111011111111111111111111111110000000000000000001111111111111111111111111111111111110111111111111110111111111111111111111111111111111101111111111111110111111111111111111111111111111111111111111
11111111111011111111111111111111111110111111111111111100111111111111111111111111111111111110111111111111110111111111111111111111111111111111101111111111111110111111111111111111111111111111111111111111
11111111111011111111111111111111111110111111111111111110111111111111111111111111111111111110111111111111110111111111111111111111111111111111101111111111111110111111111111111111111111111111111111111111
11111000000011111111111111111111111110111111111111111110111111111111111111111111111111111110111111111111110111111111111111111111111111111111101111111111111110000000000000000000000000111111111111111111
11111011110111111111111111111111111110111111111111111110111111111111111111111111111111111110111111111111110111111111111110000000000000000000000000000000111111111111111111111111111110111111111111111111
11111000000111111111111111111111111110111111111111111110111111111111111111111111111111111110111111111111110111111111111110111111111111111111111111111110111111111111111111111111111110111111111111111111
11111110111111111111111111111111111110111111111111111110111111111111111111111111111111111110111111111111110111111111111110111111111111111111111111111110111111111111111111111111111110000000000011111111
11111000111111111111111111111111111110111111111111111110111100000000000000111111111111111110111111111111100111111111111110111111111111111111111111111110000001111111111111111111111111111111111011111111
11111011111111111111111111111111111110111111111111111110111101111111111110111111111111111110111111111111101111111111111110111111111111000000001111111111111101111111111111111111111111111111111011111111
11111000000000000000000000000000000000111111111111111110111101111111111000111111111111111110000000011111101111111111111110111111111111011111101111111111111101111111111111111111111111111111111011111111
11111111111111111111111111101111111111111100000000000000111101111111111010100000000000111111111111011111101111111111111110111111111111011111101111111111111101111111111111111111110000000000000011111111
11111111111111111111111111111111111111111101111111111111111101111111111010001111111110111000000000011111101111111111111110000000000000011111101111111111111101111111111111111111111111111111111011111111
11111111111111111111111111111111111111111101111111111111111101111111111011101111111110111011111011111111101111111111111111111111111101111111101111111111111101111111111111111111111111111111111011111111
11000000000000000000000000000000000000000001111111111111111101111111111011101111111110111000000011110000000000000000111111111111111101110000001111111111111101111111111111111111111111111110000011111111
00011111111111111111111111111111111111111111111111000000000000011111111011101111111110111111011111110111101111111110111111111111111100000111101111111111111101111111111111111111111111111110111111111111
01111111111000001111111111111111111111111111111111011111111111011111111011101111111110000000011111110111101111111110111111111111111111111111101111111111111101111111111111111111110000111110111111111111
01111111111011101111111111111111111111111111111100011111111111011111111011101111111111111111111111110111101111111110111111111111000000000000000000011111111101111111111111111100000110111110111111111111
01111111111011101111111111111111111100001111111101111111111111011111111000001111111111111111111111110111100000000000111111111111101111111111101111011111111101111111111000000001110000111110111111111111
00000000000011101111111111111111100001101111111101111111111111011111111111111111111111111111111111110111111111111110111111111111101111111111101111011111110000000000000011111111111111111110111111111111
11111111111111101111111111111111001111100000000000000011111111011111111111111111111111111111111111110111111111111110111111111111100000000000000000011111111111111111011111111111111111111110111111111111
11100000000000001111111111111111011111111111111011111011111111011111111111111111111111111111111111110111111111111110111111111111111111111101111111111111111111111111011000000000000000000000111111111111
11101111111111111111111111111111011111100000000011111011111111011111111111111111111111111111111111110000000000000000111111111111111111111101111111111111111111111111011011111111111111111110111111111111
11100000000000000000000000111111011111101111111111000011111111011111111110000000000000011111111111111111111111111110000000000000000000000001111111111111111111111111011011000000000000000000111111111111
11111111111111111111111011111111011111101111111111011111111111011111111110111111111111011111111111111111111111111111111111111111111111111111111111111111111111111111011011011111111111111110111111111111
11111111111111111111111011111111011111101111111100011111111111011111111110111111111111011111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000111111111111
11111111000000000000000000000000000000001111110001111111111111011111111110111111111111011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111110011111111111111111111111111111111111111000000000000000000000111110111111111111011111111111111111111111111111111111111111111111111111111111111111111111110000000000011111111111111111111111111111
11111110111111111111111111111111111111111111111111111111011111011110111110111111111111011111111111111111111111111111111111111111111111111111111111111000000000000111111111011111111111111111111111111111
11111110000001111111111100001111111111111111111000000000000000011110000000111111111111001111111111111111111111111111111111111111111111111111111111111011111110110000000000011111111111111000000000111111
11111111111101111111111101101111111111111111111011111111011111111110111111111111111111101111111111111111111111111111111111111111111111111111111111111011111110111111111011111111111111111011111110111111
11111111111101111111111101101111111111000000000011111111011111111110111111111111111111101111111111111111111111111111111111111111111111111111111110000011111110000000111000000000000000000000000000111111
11111111111100000000000001101111111111011111111111111111000000000000111111111111110000000000001111111111111111111111111111111111111111111110000000111111111111111110111111111111111111011111110111111111
11111111111111111111111111101111111111011111111111111111111111111111111111111111110111111111101111111111111111111111111111111111111111111110111110000000000000000000111111111111111111011111110111111111
11111111111111111111111111100000000000011111111111111111111111111111111111111111110111111111101111111111111111111111111111111111111111111110111111111111111111111111111111110000000000011111110111111111
11111111111111111111111111101111111111111111111111111111111111111111111111111111110111111111101111111111111111111111111111111111111111111110000000011111111111111111111111110111111111111111110111111111
11111111111111111111111111101111111111111111111111111111111111111111111111111111110111111110001111111111111111111000000000001111111111111111111111011111111111111111111111110111111111100000000000011111
11111111111111111111110000001111111111111111111111111111111111111111111111111111110000000000111111111111111111111011111111101111111111111111111111011111111111111111111111000001111111101111111111011111
11111111111110000000000111111111111111011111111111111111111111111111111111111111111111111111111111100000000000000011111111101111111111111111111111011111111111111111111111011100000011100111111111011111
11111111111110111111111111111111111111011111111111111111111111111111111111111111111111111111111111101111111111111111111111101111111111111111111111000000000000000000000000011101111011110111111111011111
11111111111110111111111111111111111111011111111111111111111111111111111111111111111111111111111111101111111111111111111111100000000000111111111111110000001111111110111110111101111011110111111111011111
11111111111110111111111111111111111111011111111111111111111111111111111111111111111111111111111111101111111111111111111111110000000000011111111111110000001111111110111110111101111001110011100000011111
11111111111110111111111111111110000000011111111111111111111111111111111111111111111111111111111111101111111111111111111111111100000000000011111111111101111111111110111110111101111101111011101111111111
11111111111110111111111111111110111111111111111111111111111111111111111111111111111111111111111111101111111111111111111111111111100000000000011111111101111111111110111110111100000101111000000011111111
11111111111110000111111111111110111111111100000000000000111111111111111111111111111111111111111111101111111000000000000001111111111111111110011111111101111111110000111110111101110101111111111011111111
11111111111111110111111111111110111111111101111111111110111111111111111111111111111111111100000000001111111011111111111101111111111111111111011111111101111111110111111110000001110100001000000011111111
11111111111111110111111111000000111111111101111111111110000000000000000000000000011111111101111111111111111011111111111101111111111111111111011111111101111111110111111111110111110111101011111000000111
11111111111111110111111111011111111111000001111111111110111111111111111111111111011111111101111111111111000011111111111101111111111111111111011111111101111111110111111111110111110111100011111011110111
11110000000000000111111111000000000000011111111111111110111111111111111111111111000000000001111111111111000000111111110000000000000000000000011111100000000000000000000000000000000111111111100011110111
11110111011111110111111111111111110111111111100000000000111111111111111111111111111111111111111111111111111110111111111101111111111111111111111111111111011111111111111111111111111111111111101111110111
11110111011111110111111111111111110000000000001111111110111111111111111111111111111111111111111111111111111110111111111101111111111111111111111111111111011111111111111111100000000001111111101111110111
11110000000000000111111111111111111111111111111111111110111110000000000001111111111111111111111111111111111110000000000001111111111111111111111111111111011111111111111111101111111101111111100000000111
11111111101111111111111111111111111111111111111111111110111110111111111101111111111111111111111111111111111111111111111111111111111111111000000000000000011111111111111111101111111101111111111110111111
11111111101100000001111111111111111111111111111111111110000000000111111101111111111111111111111111111111111111111111111111111111111111111011111111111111111111111111111111101111111100000000000000111111
11100000000000111101111111111111111111111111111111111111110111110111111101111111111111111111111111111111111111111111111111111111111111111011111111111111111111111111111111101111111111111111111111111111
11101111111111111101111111111111111111111111111111111100000000000111111101111111111111100001111111111111111111111111111111111111111111111011111111111000000000000000000000000000000000000000111111111111
11101111110000000001111111111111111111111111111111111101111111111111111101111111111111101101111111111111111111111111111111000000000000000011111111111011111011011111111111111111101111111110111111111111
11101111110101111111111111111111111111111111111111111100000000000000000001111111111111101100000001111111111111111111111111011111111111111111111111111000000011011111111111111111101111111110000001111111
11101111110000000000000000111111111111111111111111111111111111011111111111111111111111101111111100000000001111111111111111011111111111111111111111111111011111011111111111111111100000000000111101111111
11101111111111011111110110111111111111111111111111111111111111011111111111111111111111101111111111111111101111111100000000011111111111111111111111111111011111011111111111111111111111111011111101111111
11101111111111011111110000001111111111111111111111111111111111011111111111111111111111101111111111111111001111111101111111111111111111111111111111111111011111011111111111111111111111111011111101111111
11101110000000011111111111101111111111111111111111111111100000011111111111111111111111101111111111111111011111111101111111111111111111111111111111111111011111000000001111111111111111111011111101111111
11101110111111111111111111100000000000000011111110000000001111111111111111111111111111101111111111111111011111111101111111111111111111111111111111111111011111111111101111111111111111111011111101111111
11101110111111111111111000001111111111111011111110111111111111111111111111111111111111101111111111111111001111111101111111111111111111111111000000000000001111111111101111111111111111111000001101111111
11101110111111111111111011111111111111111011111110111111111111111111111111000000000000001111111111111111100000000001111111111111111111111111011111111111101111111000001111111111111111111111101101111111
11101110111111111111111011111111111111111000000000111111111111111111111111011111111111111111111111111111111111111111111111111111111111111111011111111111101111111011100000000111111111111111101101111111
11101110111111111111111011111111111111111111110111111111111111111111111111000000000000000000011111111111111111111111111111111111111111111111011111111111101111111011111111110111111111111111100001111111
11101110111111111111111011111111111111111111110111111111111111111111111111111111111111111111011111111111111111111111111111111111111111111111011111111111101111111000000000000111111111111111110111111111
11101110111111111111111011111111111111100000000111111111111111111111111111111111111111111110011111111111111111111111111111111111111111111111011111100000000001111111111101111111111111111111110111111111
11100000111111111111111011111111000000001111110111111111111111111111111111111111111111111110111111111111111111111111111111111111110000000000000111101111101101111111111101111111111111111111110111111111
11111011111111111111111000000000011111111111110111111111111111111111111111111111111111111110111111111111111111111111111111111110000111111101110111101111101101111111111101111111111111111111101111111111
11111011111111111111111011111111111111111111110111111111111111111111111111111111111111111110111111111111111111111111111111111110110000000101110111101111101101111111111100000000000000000000001111111111
11111011111111111111111000000000111111111111110111111111111111111111111111111111111111111110111111111111111111111111111111111110111111110001110000001111000001111111111111111111111111111111111111111111
11111011111111111111111011111110000000000111110111111111111111111111111111000000000000000010001111111111111111111111111111111110111111110111111111011111010111111111111111111111111110000000000001111111
11111011111111111111111011111111111111110000000111111111111111111111111111011111111101111111101111111111111111111111111111111110111111110111111111011111000000000000000000011111111110111111111101111111
11111011111100000000000011111111111111111111110111111111111111111111111111011111111101111000001111111111111111111111111111111110111110000111111111000111101111111111111111011111111110111111111101111111
11111011111101111111111111111111111111111111110111111111111111110000000000011111100000111011111111111111111111111111111111111110111110111111111111110000001111111111111111011111111110111100000001111111
11111011111101111111111111111000000000000000000111111111111111110111111111111111101111000011111111111111111111111111111111111110111110111111111111111011111111111111111111011111111110111101111111111111
11111011111101111111111111111011111111111111110000000000011111110111111111100000000000011011111111111111111111111111111100000000111110111111111111111011111111111110000111011111111110000000000111111111
11111011111100000001111111111011111111111111111111111111011111110111111111100000000000001011111111111111111111111111111101111111111110000000000011111111111111111110110111000000000000000001110111111111
11111011111101111101111111111000000000000111111111111111011111110111111111101111111111111011111111111111111111111111111101111111111111111111111011111111111111111110110111111111111111111111110111111111
11111011111101111101111111111111111111110111111111111111000000000001111111101111111111111000000111111111111111111111111101111111111111111111110000000000000000000000110000000000000000000000000111111111
11111011111101111100000000000111111111110111111111111111011111111100000000001111111100000011110111111111111111111111111101111111111111111111110111111111111011111111111111110111111111111111111111111111
11111011111101111101111111110111111111110111111111111111011111111101111111111111111101011111110111111111111111111111111101111111111111111111110111111111111011111111111111110111111111111111111111111111
11111011111101111100000000000001111111110111111111111111000000000001111111111111111100011111110111111111111111111111111101111111111111111111110001111111111011111111111111110111111111111111111111111111
11111011111101111111111110111100111111110111111111111111111111111111111111111111111110111111110111111111111111100000000001111111111111111111111101111111111000000000000000000111111111111111111111111111
11111000000001111111111110000000111111110111111111111111111111111111111111111111111110000000000111111111111111101111111101111111111111111111111101111111111111111111011111111111111111111111111111111111
11111111111111111111111111110111111111110111111111111111111111111111111111111111111111111111111111111111111111100000000001111111111111111111111101111111111111111111011111111111111111111111111111111111
11111111111111111111111111110000000000000111111111111111111111111111111111111111111111111111111111111111111111111001111111111111111111111111100000000000000000000000011111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
7 7
1 2 7 5
1111111
0000011
1011001
1011100
1011110
1000000
1111111
7 7
1 2 7 5
1111111
0000000
1011000
1011100
1011110
1000000
1111111
7 7
1 2 7 6
1111111
0000001
1011000
1011100
1011110
1000000
1111111
7 7
1 2 7 5
1111111
0000011
1111001
1011111
1011110
1000000
1111111
180 180
4 5 96 168
000000000000000000000110000000000000000000000000000000000000000001111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
010110111011111011100000011111111110111111111111111100111110101101111111111111111111111000111011111111111001111111111111011011111111111111111111111111111111100111111111111111111110
010110111011111011101110111111111110111111111111111100000000000000000000000000000000000010111011111111111001111111111111011011111111111111111111111111100000000000111111111111111110
010110111011111011101110111111111110111111111111111110111110101101111111111111111111111110111011111111111001111111111111011011111111111111111111111111101111100110111111111111111110
000000000000000000000000111111111110111111111111111110111110101101111111111111111111111110111011111111111001111111111111011011111111111111111111111111101111100000111111111111111110
000000000010000000000000000011111110111111111110000000000000000001111111111111111111111110111011111111111001111111111111011011111111111111111111111111101111101111111111111111111110
010100101110000000001111111011111110111111111110111110111110101111111111111111111111111110111011111111111001111111111111011011111111111111111111111111101111101111111111111111111110
010000101111111011111111111011111110000111111110111110111110101111111111111111111111111110111011111111111001111111111111011011111111111111111111111111101111101111111111111111111110
000000000000011011111111100000000000000000000000000000000000001110000000000000000000000000000011111111111001111111111111011001111111111111111111111111101111101111111111111111111110
000000000000011011111111101000000000000000111100000000000000001110111111111111111111111110011111111111111001111111111111011101111111111111111111111111101111101111111111111111111110
000000001111011011111111101001101010010111111100110110111110101110111111111111111000000000011111111111111001111111111111011101111111111111111111111111101111101111111111111111111110
001000001111011011111111101101101010010111111100000000001110101110111111111111111011111111111111111111111001111111111111011101111111111111111111111111101111101111111111111111111110
000000000000011000000000000000000000000000000000110110101110101110111111000000000000000000001111111111111001111111111111011101110000011111111111111111101111101111111111111111111110
101100001100000000000000000000000000000000000000100110100000000010111111011111111011111111101111111111111001111111111111011101110111011111111111111111101111101111111111111111111110
101100001101011000001100000000000000000000000000100110101110101010111111011000000000001111101111111111111001111111111111011101110111011111111111111111101111101111111111111111111110
101100000001011000000000000000001011000000000000000110101110101010111111011011111011101111101111111111111001111111111111011101110111011111111111111111101111101111111111111111111110
101100101111011000001101010000000000000000000000000000001110100000000001011011111011101111101111111111111001111111111111011101110111011111111111111111101111101111111111111111111110
100000000000000000000000000000101000000011011110110110111110111010111101011011111011101111101111111111111001111111111111011101110111011111111111111111101111101111111111111111111110
111110101111111011001100000000000000000000000000110110111110111010000000000000000000001111101111111111111001111111111111011101110111011111111111111111101111101111111111111111111110
111110101111110000000000000000101000000110011101110110111110111011111111111011111011001111101111111111111001111111111111011100000000000000000000000000001111101111111111111111111110
111110101111110011001110000000000000000000000000000110111110111011111111111011111011001111101111111111111001111111100000000000000000011111111111111111111111101111111111111111111110
111110101111110011001110010110101101110110000000000000000000000011111111111011111011001111101111111111000000000000000000000000000111111111111111111111111111101111111111111111111110
110000000000000000000000000110101101110110000000000000000000000000000000001011111011001111101111000000011001111111100111011101111111111111111111111111111111101111111111111111111110
110110111111110111001100000000000000000000000000000110011111111011111111101011111011001111101111011111111001111111100111011101111111111111111111111111111111101111111111111111111110
110110111111110111000000000000000001110011001100100110011111111011111111101011111011000000000000001111111001111111100111011101111111111111111111111111111111101111111111111111111110
000000000000000000000001001010101101110011000000000110011111111011111111101000000011001111101111001111111001111111100111011101111111111111111111111111111111101111111111111111111110
010110111111110010111100000000001101110011000000100111111111111011111111101111110011000000000000001111111001111111100111011101111111111111111111111111111111101111111111111111111110
010110111111110000000000000000000001110011011101100111111111111011111111100000000000011111101111011111111001111100000000000101111111111111111111111111111111101111111111111111111110
010110111111110110111101000000111110000000011101100111111111110000111111111111110011011111101111011111111001111101100111010101111111111111111111111111111111101111111111111111111110
010110111111110110111101000000000000010011011101100111111111110010111111111111110011011111101111011111111001111101100111010101111111111111111111111111111111101111111111111111111110
000110111111110110111100000000000000000011000001100111111111110010111111111111110011011111101111011111111001111101100111010101111111111111111111111111111111101111111111111111111110
000110111111110110111101000000000000010111001001100111111111110010111111111111110011011111101111011111111001111101100000010101111111111111111111111111111111101111111111111111111000
000110111111110110000000000000000000000111001001100111110001110010111111111111110000011111101111011111111001111101101100000000000000000000001111111111111111101111111111111111111010
000110111111110110011101011001111111010110001001100111110101110010111111111111110111111111101111000000000011111101000001010101111111111111101111111111111111101111111111111111111010
000110111111110110011100011000000000000000001001100111110101110010111111111111110111111111101111111111111011111101001111010101111111111111101111111111111111101111111111111111111010
000110111111110110011101000000000000000000001001100111110101110010111111111111110111111111101111111111111011111101001111010101111111111111101111111111111111101111111111111111111010
001110111111110110011101000000000000000000001001100111110101110010111111111111110111111111100000000000000000000001001111010101111111111111101111111111111111101111111111111111111010
001110111111110110011101000000000000000000000001100111110101110010111111111111110111111111101111111111111011111111001111010101111111111111101111111111111111101100000000000000000000
001110111111110110011101000000000000000000101011100111110101110010111111111111110111111111101111111111111011111111001111010101111111111111101111111100000000000000000000000000000000
000000000000000000011101001101110000100010101011100111110101110000000000000111110111111111101111111111111011111111001111010101111111111111101111111101111111100001111011111100000000
001110000000000000000000000000110000000000000000000000000000000000111111110111110001111111101111111111111011111111001111010101111111111111101111111101111111111111111011111101110110
000011111111110100011100001100111000100000000011100111110101110011111111110111111101111111101111111111111011111111001111010000000000000000001111111101111111111111111011111101110110
001011111111110101011100000000000000101010101111100000000000000000000001110111111101111111101111111111111011111111001111000000111111111111111111111101111111111111111011111101110110
011011111111110101011100001100000000101010000011100011110111111111111101110000000001111111101111111111111011111111001111011100111111111111000001111101111111111111111000100000000110
000000000000000000000000001100111000000000000000000000110011111111111101111111000000000111101111111111111011111111111111011100111111111111011101111101111111111111000000000000000110
011011111111110000000000000000000000000011111011101010111011111111111101111111010000000000000000000000000000000000000000011100111111111111011101111101111111111111011010101101100110
011011111111110001111100000000000000000000000000000000000000011111111101111111010101100000000000000000000011111111110000111100111111111111011101111100000000000000000000000000000110
011011111111110001111100100000000000000000000011101010111010011111111101111111010101100000000000000000000000000111110110111100000000000000000001111111111111011111111011100100000000
000011111111111011111100111001011100101101110011101010000000011111111101111111010101100000000000000000110111110111110110111101111111111101011000000000000000000000000000000000100000
011111111111111011111100111001011100000000110011101011111011011111111101111111010100000000000000000000000111110111110110100001111111111101000000000000000000000000000000000000000000
011111111000000000000000000001011100101100110011101011111011011111111101111110000000111111101100111010111111110111110110101101111111111101111001111111111111111111111011110100110110
000000000000000000000000000001011100101100000000000000000000011001111100000110000000111111101100111000001111110000110110101100000000000001111001111111111111111111111000000000110110
011111111010111000000000000000000000000000111011101000000000000001111111110000010101111110000000001000101111111110110110101111111111111111111001111111111111111111111011110100110110
011111111010111111110111111101000000000000000000000000111011010001111111111111010101111110101101101000101111111110110110101111111111111111111001111111111111111111111011110100110110
000000000000000000000000000000000000000000000000001010111011010001111111111111010001111110101100000000000000000000110110000000000000000000000001111111111111111111111011110100000000
011111111010111111111100000000000000000000000000000000000000010001111111111111011111111110101111101000101111111100110110001111111111111111111011111111111111111111111011110101110110
011111111010111111111101110101011100101111111011011010111011000001111111111111011111111110101000000000101111111100110110001000000000000000000000000000000000000000011011110101110110
011111111010111111111101110101011100101111111011011010111011010011111111111111011111111110101011101001101111111000110110001011111111111111111011111111011111111110011011110101110110
011111111010111111111101110101011100101111111011011010111011010011111111111111011111111110101011101001101111111001110000000011111111111111111011111111011111111110011011110101110110
000000000000000000000000000101011100101111111011011010111011000011111111111111011111111110101011101000000000000000000000101111111111111111111011000011000111111110000000110101110000
011111111010111111101101110101000000101111111011011010111011111011111111111111011111111110101000000011101111111001111101101111111111111111111011011011000000000000000000000001110010
000000000000000000000001110101111100101111111011011010111011111011111111111111011111111100000000000000001111111001111101101111111111110000000000000000001111111110111010101001110010
011111111010111111101100000101111100101111111011011010100000000011111111111111011111111100101111000111001111111000000000000000111111110111111011000000001111111110111010101001110000
011111111010111111101101111101111100101111111011011010101011111111111111111111011000000000000000000000000011111011111101101110111111110111111011111011111111111110000000000000000000
011111111010111111101101111101111100101111111011011010100010000000000000000000000010000000101011000111001011111011111101101110111111110111111011111011111111111110111010101001110110
011111111010111111101101111101111100101111111011011010111010111111111111111111011110111100101011000111001011111011111101101110111111110111111011111011111111111110111010101001110110
011000000000000000000000000001111100000000000000000000000010111111111111111111011110111100101011000111000000000011111101101110111111110111111011111011100000000000111010101001110110
000000000000000000000000011111111110000000111001011010000000000000000000000000000000000000000001000111101011111011111101101110000000000000001011111011101111000000111010101001110110
000000000000111111111111111111111110000000000000000000000010111111111111111111000000111100100000000111101011111001111101101111111111110111101011111011101111011110111010101001110110
000000000000111111111111111111111000000000000001110010111110111111111111111111011100000000000000000000000000000001111000001111111111110111101011111000000001011110111010100000000000
001111111001111111111111111100000000000000000001110000111110111111111111111111011110111100101001100111101011111111111001111111111111110111101011111011101101011110111010100000010100
001111111000000000000000000000000000111101111111111010111110111111111111111111011110000000001000000000000011111111111001111111111111110111101011111011101101011110111010001001010100
001111111101111111111111111101111011111101111111111010111110111111111111111111011111111100111000000111101111111111111001111111111111110111101011111011101101011110111010111001010100
001111111101111111111111111101111011111100000000000000000000111111111111111111011111111100111011111111101111111111111001111111111111110111101011111011101101011110000000000000000000
000001110000000000111111111101111011111111111111111010111111111111111111111111011111111100000011111111101111111111111001111111111111110111101011111011101101011110111010111000000000
001101110101111110111111111101111011111111111111111010111111111111111111111111011111111111111011111111101111111111111001111111111111110111101011111011101101011110111010111000101110
000000110101111110111111111101110000111111111111111000000000000000000000000000000000000011111011111111101111111111111001111111111111110111101011111011101100011110111010111000101110
000000000001111110111111111101110010111111111111111010111111111111111111111111011111111011111011111111101111111111111001111111111111110111101011111011101111000000000000000000101110
011101111001111110111111111101110010111111111111111010111111111111111111000000000000000000000000000001101111111111111001111111111111110111101011111011101111011111111000111100101110
011101111001111110111111111101110010111111111111111010111111111111111111011111011111111011111011111101101111111111111001111111111111110111101011111011100000011111111000111100101110
000001111001111110111111111101110010111111111111111000111111111111111111011111011111111011111011111101101111111111111001111111111111110111101011111011100111011111111000111100000000
011111111001111110111111111101110010111111111111111011111111111111111111011111011111111011111011111101101111111111111001111111111111110111101011111011100111000000000000000000101110
011111111000000000111111111101110010111111111111111011111111111111111111011111011111111011111011111101101110000000111001111111111100000111101011111011100111011111111110111000100000
011111111101111111111111000000000010111111111111111011111111111111111111011111011111111011111011111101101110111110111001111111111101100111101000000000000000000000000000111000100111
011111111101111111111111011101110110111111111111111011111111111110000000000000000001000011111011000000000000000000000000000000000001100111101111111011100111011111111111111000100111
011111111101111111111111011101110110111111111111111010000000000000000000000000000000000011111011011011101110111110000000000000111111100111101111111011100111011111111111111000100111
011111111101111111111111011101110110111111111111111010111111111110111111011110111101011011111011011011101110111111111111111110111111110000001111111011100111011111111111000000000001
011111111101111111111111011101110110111111111111100000111111111110111111011110111101011011111011011011101110111111111111111110111111110111111111111011100111011111111111011000100101
000000000000001111111111011101110000111111111111101011111111111110111111011110111101011011111011000000000000000000000000001110111111110111111111111011100110000000000000000000000101
000000000000000000000001000000000000000000000000101011111111111110000000011110111101011011111011111011101110111111111111101110111111110111111111111000000000000000000000000000110101
000001111001111110111101001100000011111111111110101011111111111111111111111110111101011011111011111011101110111111111111101110111111110111111111111011100110011111111110011001110101
001111111001111110100000001111111011111111111110101011111111111111111111111110111101011011111011111011101110111111111111101110111111110111111111000000000110011111111110011000010101
001111111001111110101101001111111011111110000000000000000011111111111111111110111101011011111011111011101110111111111111101110111111110111111111011011110000011111111110011001010101
001111111001111110101101001111111011111110111110101011100011111111111111111110111101011011111011111011101110111111111111101110111111110111111111000000000000011111111110000001010101
001111111001111110101101001111111011111000111110101011100000000001111111111110111100011011111011111011101110111111111111100000000000000001111111001011111110011111111110001001010100
001111111001111110000000000000000000000000000000000000000000000000000000000000000001111011111011111011101110111111110000000000111111110101111111001011111110011111111110001001010110
001111111001000000000000001111111011111011111110101011111000000001111111111110111100111011111011111011101110111111110111111100111111110101111111001011111110011111111110001001010110
011111111000011111111111000000000000000000000000000000000011111111111111111110111110111000000000000011101110111111110111111100111111110101111111001011111110011111111110001001010110
000000011101011111111111001111111011111011111110101011111111111111111111111110111110111111111011111111101110111111110111111100111111110101111111001011111110011111110000000001010110
011111011101011000000000000000000000000000000000000000000000000000000000000000111110111111111011111111101110111111110111111100111111110101111111001011111110011111110110011011010110
011111011101011011111111001111111011111011111110101011111111111111111111111111111110111111111011111111101110111111110111111100111111110001111111001011111100000000000000000011010110
000000000000011011111111001111111011111011111110101011111111111111111111111111111110111111111011111101101110111111110111111100111111111111111111001011111100011111110110011111010110
001110000000011011111111001111111011111011111110101011111111111111111111111111111110111111111000000000001110111111110111111100111111111111111111001011111100000000110110000000010110
001110011101011011111111001111111011111000000000000011111111111111111111111111111110111111111111111101111110111111110111111100111111111111111111001011100110011110110110011111110110
001110011100011011111111001111111011111111111110101011111111111111111111111111111110110000000000000101111110111111110111111100111111111111111111001011100000011110110110011111110110
001110000000000000000000001111100011111111111110101011111111111111111111111111111110110111111111110101100000000000110111111100111111111111111111001011100011011110110110011111110110
001110111111011011111111001111101111111111111110101011111111111111111111111111111110110111111111110101101110111110110111111100111111111111111111001011100000001110110110000000110110
001110111111011011111111001111101111111111111100000000000000001111111111111111111000000000000000000101101110111110110000000000111111111111111111001011100111001110110110011110110110
000000000000000000000000001111101111111111111100101011111111101111111111111111111010110111111111100101101110111110110111111101111111111111111111001011100111000000000000000000000110
000000000000000000000000000000000000011111111100101011111111101111111111111111111000000000000000000000000000011110110111111101111111111111111111000011100111011110110110011110111110
001110111111000000000000000000101111011111111111101011111111101111111111111111111110110111111111100000000000000000000111111101111111111111111111011111100111011110110110011110111110
000000000000000000000000000000001111011111111111101011111111101111111111111111111110110111111111101100000000011110110111111101111111111111111111011111100111010000000000000000000000
001110111111001110111101111000000000000011111111101011111111101111111000000000000110110111111111101101100000000110110111111101111111111110000000000000000111010110110110011110111110
000000000000000000000000000000000000011011111111101011111111101111111011111111110110110111111111101101111111110110110111111101111111111110111111011111110111010110110110011110111110
001110111111001110111101111001001111000011111111101011111111101111111011111111110110110111111111101101111111110110000111111101111111111110111111011111110111010000000000011110111110
001110111111000000111101111001001111011111111111101011111111101111111011111111110110110111111000000101111111110111111111111101111111111110111111011111110111011110110110011110111110
001110111111000110000001111000001111011111111111101011111111101111111011111111110110110111111011100101111111110111111111111101111111111110111100011111110111011110110110011110110000
000000111111000110111100000000011111011111100000000011111111101111100000000111110110110111111011100101111111110111100000000000001111111110111101111111110111011110110110000000000000
000011111111000110111101111101111111011111101111101011111111101111101011110111110110110111111011100101111111110111101111111100101111111110111101111111110111011110110111011110110110
000011111111000110111101111101111111011111101111101011111111101111101011110111110110110111111011100101111111110111101111111110001111111110111101111111110111011110110111011110110110
000011111100000110111001111101111111011111101000001011111111101111101011110111110110000111111011100001111111110111101111110000001111111110000001111111110111011110110111011110110110
010111111000000000111001111101111111011111101011101011111111101111101011110111110000000111111011110111111111110111101111110110101111111110011101111111110111011110110111011110110110
010111111001001111111001111101111111011111101011100000000000000000000001110111111110000000000000000000000000000000000000110110101111111110000000001111110111011110110110011110000000
010111111001011111111001111101111111011111101011001011111111111111100001110111100000000011111011111111111111110011101110110110101111111111011101101111110111011110000110011111110010
010111111001011111111001111101111111011111101011001011111111111111100001110111101100110011111011111111111111110011100000000110101111111111011100000000000011011110111110011111111000
010111111001011111111001111101111111011111101011000011111111111111100001110111101100110011111011111111111111110000000000000000000000000000000000001111110000000000000010011111111000
010111111001011111111001111101111111011111101011101111111111111111000001110111101100110011111011111111111111110011100000000000000000000000000001001111110000011100111010011111111000
010111111001011111111000000001111111011111101011101111111111111111010001110000000000000011111011111111111111110011110111110110111111111011101111001111111111111100000000011111111000
010111111001011111111001111111111111000011101011101111111111111111010001111111101100110111111011111111111111110011110111110110000000000000001111001111111111111101111011011111111000
010111111001011111111001111111111111111011101011101111111111111100000001111111101100110111111011111111111111110011110111110111111111111011111111001111111111111101111011011111111010
010110000000000000000001111111111111100000001011101111111111111101010101111111101100110111111011111111111111110011110111110111100000000011111111001111111111111101111011011111111010
010110111011011111110000001111000000000000000011100000000000000000000100000000000000000111111011111111111111110011110111110100000000000001111111000000000000000000011011011111111010
000000111011011111110001101111010011101011101111101111111111111101011111111111100000111111111011111111111111110011110110000001101111111101000000001111111111111101011011011111111010
000000000000010000000000000000010011101011101111101111111111111101010001111111111011111111111011111110000000000000000000000011101111111101011111001111111111111101011011011111111010
000000110001110111110001101111010011101011101111101111111111111101010101111110000000000000000000000000110000000000000000000000001111111101000000001111111111111101011011011111111010
100111110001110111110001101111010000000001101111101111111111111101010000000000001011111111111011111111110011010111110111110011111111111101111111101111111111111101011011011111111010
000111110001110111110000000000000000000001101111101100001111111101010101111110001000000000000000000000010011010111110111110011111100000001111111101111111111111101011011011111111010
010111110001110111110001101111010111101101101111101101101111111101010101111111111011111111111011111111010011010111110111110011111101111111111111101111111111111101011011011111111010
010111110001110111110001100000000000000000000000000000000000000101010101111111111011111111111011111111010011000011110000000000000001111111111111101111111111111101011011011111111000
010111110001110111110001111101010101101101101101101101011111110101010101111111111011111111111011111111010011010011111111110011111111111111111111101111111111111101011001011111100010
010111110000000111110001000000010000000001101101101101000001110101010101111111111011111111111011111111010011010011111111110011111111111111111111100000000000000000000000000000000000
010111111001111111110001011101011101101111101101101101111101110001010101111111111011111111111011111111010011010011111111110011111111111111111111111111111111111101011101111111101110
010111111001111111110001011001011101101111101101101101100101111001010101111100000001111111111011111111010011010000000000000011111111111111111111111111111111111101011101111111101110
000000000001111111110001011001011101101111101000001101100100000000000000000001111001111111111011100000000000000000000000000011111111111111111111111111111111111101011101111111101110
010111111101111111110001011001011101101111100000000001100111111001010101111111111001111111111011101111010111010111111111110111111111111111111111111111111111111101011101111111101110
010111100000000000000001011001011101101111111001111111100111111001010000001111111000000000000000000000000000010111111111110111111111111111111111111111111111111101011101111111100010
010000001101111111110001011001011101101111111000000000000000000000000001101111111001111111111011101111010111110111111111110111111111111111111111111111111111111101000000000000000000
011111111101111111110000000001000000000110000011111111101101111001010001101111111001111111111011101111010111110111111111110111111111111111111111111111111111111101111101111111111010
011111111101111111110101010001011101100110111011111111101101111001010001101111111001111111111011101111000000000000000000000111111111111111111111111111111111111100000000000001111010
011111111101111111110101010001011101100110111000000000000000000000000000000000000000000011111011101111110111110111111111110000000000000000000011111111111111111111111101111101111010
000000000000000000000000000000000000000110111011111111101101111001010100101111111001111011111011101111110111110111111111110111101110111111111011111111111111111111111101111101111010
011111111101111111111101110000000001111110111011111111101101111001010100101111111001111011111011101111110111110111111111110111101110111111111011111111111111111110000000000000000010
000000000001111111111101110001011111111110001011111111101101111000000100100000000000000000000000001111110111110111111111110111101110111111111011100000000000000000011101111101110010
011111111111111111111101110001011111111111101011111111101101111001011100100111111001111011111011111111110111110111111111110111101110111111111011101111111111111101000000000000000000
011111111111111111111100000000000000000000000000000001101101111001011100100111111001111011111011111111110111110111111111110111101110001111111011100000001111111101111101111110000000
011111111111111111111111110000000000000000001011111101101101111001011100100111111001111000000000000000000001110111111111110111100000001111111011111100000111111101111101111111110010
011111111111111111111111110101011011111111111011111101101101111001011100100111111001111111101111111000000101110111111111110111111111111111111011111101100111111101111101111111110010
011111111111111111111111110101011011111111111011111101101101000000000000000011111001111111101111111011111101110111111111110111111111111111111011111101100111111101111101111111110010
011100000111111111111111110101011011111111111011111101101101011000000000000000000001111111101111111011111101110111111111110111110000000000001011111101100111111101111101111111110010
011101110111110000111111110000011011111111111011111101101101011001011100100011111101111111101111111011111101110111111111110111110111111111101011111101100111111101111101111111111110
011101110111110000000000111101111011111100000000000000001101011000000000000011111101111111101111111011111101110111111111110111110000000000000011111101100111111101111101111111111110
011101110111110010111110111101111011111101111011111101111101000001011100110011111101111111101111111011111101110111111111110000000000000111101111111101100000000000000000000000000000
011101110111110010111110111101111011111101111011111101111101111111011100110011111101111111101111111011111101110111111111110011110111110000000000000000000000000000000000000000111110
011101110111110010111110111101111011111101111011111101111101111111011100110011111101111111101111111011111101110111111111110011110111111111101111111101101111111101111101111110111110
000001110111110000000000000001111011111101111000000000000000000000000000110011111101111111101111111011111101110111111111110011110111111111101111000001101111111101111101111110111110
111001110111111010111110111101111000001101111001111101111001111111111100110001111101110001101111111011111101110111111111110011110111111111101000000000000000000000111101111110111110
111001110110000000000000000000001011101101111001111101111011111111111100111001111101110101100111111011111100000011111111110011110111111000000000011111111100000000111101111110111110
100000000000000000000000000000000000001101111001111101111011111111111100111001000000000000000000000000000000000000000000000000000111111011101011111111111111111101110000000000111110
101010111110111010111110011101101011111101111000000001111011111111111100111001011111111101111111111111111111110011111111110011110111111011100000111111111111111101110101111111111110
101010111110000000000000000001101011111101111100000000000011111111111100111001011111111101111111111111111110000000000000000000000111111011111010111111111111111101110101111111111110
100000000000000000000000000000000000011101111111111111111111111111111100000000001111111101111111111111111110110011111111110011110111111011111010111111111111111101110000000111111110
000010111111111010111110000000000011011101111111111111111111111111111100111111001111111101111111111111111110110011111111110011110111111011111010111111111111111101111100000000000000
011110111111111010111110011111101011011100000000011111111111111111111100111111001111111101111111111111111110000011111111110011110111100000000000000000000000001101111111100111111100
011110111111111010111110011111101011011111111111011111111111111111111100111111001111111101111111111111111111110111111111110011110111101011111000111111101111101101111111101111111100
011110111111111000000000000000101011011111111111011111111111111111111100111111001111111101111111111111111100110111111111111111110111101011111000110000000000000000000000000000000000
011110111111100000000000000000000000011111111111011111111111111111111100111111001111111101111111111111111100110111111111111111110111101011100000000000001111101101111111101111111100
011110111111101010111110010110101001111111111111011111111111111111111100000000001111111101111111111111110000110111111111111111110111100000001110110111111111101101111111101111111100
011110111111101010111110010110101001111111111111011111111111111111111101111111101111111101111111111111110110110111111000000000000000000000000000000100000011101101111111101111111100
011110111111101010111110010000101001111111111111011111111111111111111101111111101111111101111111111111110110110111111011111110000111111011011111111101111011101101111111101111111100
000000000000000000000000000000000001111111111111000000000000000000000000000000000000000001111111111111110000000000000000000000000000000000000000000000000011100001111111100000000000
*** output
4
8
7
10
265
3
1
2
-1
10
*** code 
#include<iostream>
using namespace std;
int ans;
int N, M;
int map[205][205];
int startx, starty;
int desx, desy;
int visit[205][205];

int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};

// queue
int qx[10000];
int qy[10000];
int front = -1;
int rear = -1;
bool isEmpty(){
	return front == -1;
}
void push(int x, int y){
	if (front == -1) front = 0;
	rear++;
	qx[rear] = x;
	qy[rear] = y;
}
void pop(){
	if (front >= rear) front = rear = -1;
	else front++;
}

void BFS(int x, int y){
	front = rear = -1;
	push(x,y);
	while(!isEmpty()){
		int x1 = qx[front];
		int y1 = qy[front];
		pop();
		for (int i = 0; i < 4; i++){
			int x2 = x1 + dx[i];
			int y2 = y1 + dy[i];
			while (x2>=1 && x2<=M && y2>=1 && y2<=N && map[x2][y2] == 0){
				if (visit[x2][y2] == -1){
					visit[x2][y2] = visit[x1][y1] + 1;
					push(x2,y2);
				}
				if (x2 == desx && y2== desy) return;
				x2 += dx[i];
				y2 += dy[i];
			}
		}
	}
}

int main(){
	freopen("input.txt", "r", stdin);
	int TC; cin >> TC;
	int tc;
	for (tc = 1; tc <= TC; tc++){
		cin >> N >> M;
		cin >> starty >> startx >> desy >> desx;
		for (int i = 1; i <= M; i++){
			for (int j = 1; j <= N; j++){
				char a; cin >> a;
				map[i][j] = a - '0';
			}
		}
		// reset visit
		for (int i = 1; i <= M; i++){
			for (int j = 1; j <=N; j++){
				visit[i][j] = -1;
			}
		}
		BFS(startx,starty);
		ans = visit[desx][desy];
		cout << ans << endl;
	}
	return 0;
}