Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
55 kB
0
Indexable
Never
*** De ***
Crazy King
King Peter lives in kingdom A, and his daughter in kingdom B. King received a letter telling that her daughter gave birth to a child. King is incredibly curious to see his grandchild! Unfortunately that’s not gonna be that easy.
Kingdoms A and B are separated by a forest. There are lots of enemies in the forest, and King is not that curious to see them. If they attack king on his way to kingdom B, then he will never ever see his grandchild and daughter again because of lethal consequences.

Security Council of the King disposes information about location of the enemies, which makes the things easier for king. For some unknown reason a forest is MxN chessboard. (N is the number of rows, and M is the number of columns). N,M <=100 are positive integers.

Enemies of the King can ride horses as showed in the picture. Usually horses ride (or jump) that way in Chess. Unfortunately king can’t take an airplane from point A to point B because it is not invented yet. So he moves the same way as chess-king does (refer to picture for details).   





King can’t move to a square X, if a horse of the enemy is on that square. While the king is moving horses are not, but if at least one horse can reach square X in one move, then king can't move to that square (except for the case when square X is either kingdom A or B).

You are the chief of Electronic Intelligence department of kingdom A (by the way the computers are already invented). And you’re asked to find the length of the shortest route L from kingdom A to

B, as king can’t wait any longer.

Input

The first line of input contains the number of tests T <=100. The first line of each test contains 2 numbers M and N. Then M lines follow each containing N symbols from the set S = { ‘.’, ‘Z’, ‘A’, ‘B’}. ‘.’ means that square is not occupied. ‘Z’ - horse occupies that square. ‘A’ - kingdom A, ‘B’ - kingdom B. Each test contains exactly one kingdom A and B.

Output

Find number L for each test and print line L if King can reach kingdom B. Replace L with corresponding number. If King can’t safely reach the kingdom B print line -1.

Sample

Input
4
5 5
.Z..B
..Z..
Z...Z
.Z...
A....
3 2
ZB
.Z
AZ
6 5
....B
.....
.....
..Z..
.....
A..Z.
3 3
ZZ.
...
AB.
 
Output
-1
1
5
1


*** input ***
20
5 5 
.....
.....
A....
BZ...
.....
5 5 
B....
.....
....A
Z....
.Z...
5 5 
.....
.A...
BZZ..
Z....
.....
5 5 
Z....
B.AZ.
..Z..
...Z.
Z....
5 6 
A....
.....
....Z
B....
.....
.....
6 8 
.A....
......
B.....
......
......
.Z....
.Z.Z..
..Z.Z.
5 7 
.....
Z....
A...Z
Z.B..
.Z...
Z....
..Z.Z
8 5 
........
......Z.
.....A.Z
.......Z
...BZ...
48 57 
Z..ZZ............................ZZ.............
.....ZZ...Z.....Z..........Z.Z....Z.............
.....Z.Z....Z.Z...Z.......ZZ........Z...........
........Z............Z.Z....Z..........Z....ZZ..
.Z........ZZ...Z..............Z.............ZZ.Z
Z..Z...Z..........ZZ..ZZ..ZZ......Z..Z....Z.Z..Z
..........ZZ...Z..........Z.Z..........ZZ.......
......Z....Z..Z......Z...Z.Z........Z..Z...Z....
.Z.........Z.Z.......Z...........Z.......Z.Z....
......Z............Z...Z............Z....ZZ....Z
.......Z........Z.....Z........Z.Z.Z.....Z...ZZ.
.Z.............Z.Z............Z.....Z...Z..Z..ZZ
......Z......Z.........ZZ.Z.Z....Z......Z.......
...........ZZ.........Z........ZZ..Z.Z....Z..ZZ.
...Z..Z................ZZ........Z..Z.....Z.Z...
....ZZZ....................Z..........Z.Z.......
...Z....Z..ZZ...Z.Z..Z............Z......Z......
...Z...................ZZ..Z.....Z..............
......Z.....................Z.......Z........Z..
.....Z............Z..Z...Z.....Z.Z......Z....Z..
...Z...Z.Z..........Z......Z........Z.......Z..Z
..............Z..............ZZZZZ.........Z....
....Z...Z....Z.....Z...............ZZ...ZZ......
..Z.ZZ......Z..............ZZ..Z................
........Z.ZZ.Z..Z...ZZ.........Z.Z.ZZ.......Z...
....Z......Z..Z..Z.....ZZ.Z....Z........Z.Z....Z
...Z.......ZZZ...............Z.......Z.ZZ..Z...Z
...Z....Z.....Z....Z..Z........Z.....Z...Z...Z..
......Z.......ZZ............Z..Z......Z....Z...Z
..Z..Z....Z...........Z..Z.Z......Z.ZZ.....Z....
.......Z............Z.Z.........Z......Z......Z.
...Z.......Z.ZZ.......ZZ...Z.ZZ......Z........Z.
........Z.............Z...............A.....Z...
.............Z..Z...............Z.Z....Z...Z.Z.Z
......Z...Z..Z...Z.......Z..ZZ.....Z.......Z....
........Z..ZZ....Z........Z.Z.....Z.....Z..Z.Z..
ZZ...................ZZZ.ZZZ.Z........Z..Z......
........Z....Z.Z........Z.Z......Z..............
.........Z..................Z.....Z........Z....
......ZZ............Z......Z...Z...Z...Z..ZZZZ..
.........Z.......Z..Z...Z......Z.Z.Z..Z....Z....
........Z....Z....ZZ.............ZZ........Z.Z..
Z......Z................................Z...Z...
..Z...Z..............Z..............Z....Z.....Z
.......Z....ZZ.Z........Z..Z...................Z
.Z....Z......Z.Z.....Z..ZZ.Z............ZZ......
..ZZ................ZZ.Z...Z......Z.Z...........
....Z.Z...Z..Z..........Z..........Z....Z..Z....
......Z....ZZZ..............Z..ZZ........Z...B..
..........Z.Z.Z.Z...Z.Z.........................
...ZZ........................Z.......ZZ....Z..Z.
.Z.ZZ........ZZZ...ZZ...Z............ZZ.........
Z.....Z.....Z........Z.....ZZ........Z..ZZZZ....
..........ZZ..........Z..Z...ZZ.Z...............
...........Z.....Z.Z....Z.....ZZ...........ZZ...
Z.....ZZ...Z..Z......ZZ......ZZ.................
.ZZ.......ZZ....Z...Z...............Z...Z......Z
27 49 
..................ZZ....ZZZ
Z.....Z..Z...Z.....Z......Z
............Z...Z..ZZ......
......Z....Z.............Z.
............Z.....Z....Z...
....Z........Z..Z.........Z
......ZZ.............Z.....
Z........Z....Z......Z.....
ZZ...........Z.............
.Z.Z.....Z.......ZZ....ZZ..
.Z.Z....Z..Z...Z...........
...................Z.......
.Z......................ZZ.
............Z....Z.....ZZ.Z
..........Z..............Z.
.......................ZZ..
..Z..Z......Z...Z..........
...................Z.......
Z.Z..Z.....ZZ..Z........Z..
Z..Z.....Z...Z.....Z..Z....
....................Z......
.Z...................ZZ....
.........ZZ.....Z.....Z....
...Z.Z.....................
Z..Z..Z..Z.Z........Z...Z..
...Z.............ZZ........
..................Z.Z..Z...
ZZ.........Z...........Z...
.......Z..Z.Z.........Z..Z.
.....ZZZ...Z.....A...Z.....
.............Z....Z..Z...Z.
.Z.Z.ZZ...Z....ZZ........Z.
...Z..ZZ..Z....ZZZ.......Z.
..Z.Z......Z........Z......
...Z.Z...Z.................
.........Z........ZZ..Z....
............Z....Z...Z.....
..Z.Z........Z...Z.........
ZZZ......Z.Z...Z......Z....
...Z.............Z.........
.Z............Z..Z.....Z...
.........................ZZ
......ZZ........Z..ZZ.Z....
....Z.......Z..Z..........Z
..........................Z
ZZZ.........Z....Z.Z..Z..Z.
........Z...........Z......
.Z.Z............Z.......ZZ.
..ZB...Z............Z......
17 30 
...Z.......ZZ.Z..
...........Z.....
.......Z.Z.......
...ZZ............
......Z..Z.......
...........Z.....
.Z.Z......Z.....Z
....Z......Z.....
................Z
..........Z..B..Z
.......ZZ.Z......
Z.....Z.....Z....
..........Z....Z.
.Z.Z....Z........
................Z
.Z.....Z.Z.....ZZ
.........Z......Z
........Z........
.................
.............Z..Z
Z..Z..Z..........
.................
.Z.ZZ............
.............Z...
..........Z.Z.Z..
....Z.Z.Z.Z....Z.
..Z.....Z..Z.....
..............A..
...Z........Z.Z..
.Z.........Z.....
45 66 
Z..Z......Z......Z...ZZ..Z......Z...ZZ.Z.....
Z.......ZZ........ZZ.ZZZ........Z.....Z....ZZ
....Z.........Z.Z......Z.....ZZ.........Z....
.....................Z.......Z..........Z...Z
........Z...................Z................
....Z...Z...........ZZ.........Z.....Z....Z.Z
....Z..........ZZ..............ZZ.....ZZZZZZ.
..Z.Z.........Z.Z........Z........Z..Z..Z..Z.
...ZZZ.ZZ....Z...ZZ....Z.ZZ.........Z.......Z
......Z...Z.....ZZZ...ZZ................Z....
...Z.......ZZZ...Z...................Z.......
Z...Z...........Z...Z..Z.Z................Z..
.....................Z....Z............ZB...Z
.Z.Z..............ZZZ.....Z...Z..........Z.ZZ
...........Z.......ZZ..........Z...Z.........
...Z...............Z..ZZ..............Z..Z...
.............Z.......ZZ....ZZZ.Z..Z.....Z...Z
.....Z..........Z....Z..Z.......Z............
...........Z..............Z..........Z...Z...
....Z.......Z.Z........Z.....................
..........Z.........Z..ZZ.Z............ZZ.ZZ.
.Z......Z.Z.....Z.Z.Z..Z.....Z..............Z
Z.............Z................Z.............
Z....ZZ.ZZ.Z......Z.....Z........Z...........
..Z.......Z.....Z...Z....ZZ.............Z....
............Z...Z...ZZ.......................
....Z....................Z.Z...Z..Z......ZZ..
.Z.......Z....Z....Z......Z............ZZZZ..
....Z.Z....ZZ...Z.........Z....Z.....Z.......
.Z...........ZZ......Z......Z................
.....Z.Z....Z......ZZ....ZZ.......Z......Z...
.......Z..........Z.....Z....ZZ.........Z....
....Z....Z..ZZ.......................Z.Z.....
.........ZZ.................Z...Z..ZZZ.......
.Z..Z......Z........Z.................Z......
..Z..Z...Z....Z......Z..............Z..Z.....
....Z..Z..Z..Z..Z........Z...Z.Z..ZZ.......Z.
Z.Z.ZZ.........Z............Z................
ZZ.Z....Z.A........Z....................Z...Z
.....Z........ZZ......ZZ......Z.......ZZ.....
......Z..ZZ.....................ZZ......Z...Z
......Z....Z.........Z.Z..........ZZ.....Z...
......Z...Z.ZZ...................ZZ..........
.Z..............Z..Z..Z.ZZ....ZZ...Z..Z...Z..
.ZZZ.....Z.................ZZZ.............Z.
.......Z......Z...ZZ.Z.......................
Z.Z.....ZZ...................Z..........ZZZ..
.......Z......Z...Z..........Z.Z...Z......ZZ.
Z..............Z.......Z.............Z.Z.ZZ..
Z...Z........Z..........Z.............Z....Z.
....ZZ..Z.....Z..ZZZ........Z.........Z.....Z
Z.Z.Z.Z.....Z.Z..Z....Z..........ZZ..........
.........Z............Z.Z....Z.Z........Z....
.Z...........ZZ..Z..........................Z
................Z.....Z....Z..............Z.Z
.....Z......Z.Z............Z.......Z.Z.......
......Z.............Z.........Z......Z..Z....
..Z..........Z....ZZ..............Z.......Z..
..Z....Z.................................Z...
.....................ZZ.......Z............Z.
Z...........Z.........ZZ...Z............ZZ...
..ZZZ..........ZZ............Z..........Z..Z.
....Z.....Z......Z.Z...Z....Z................
..ZZ..............Z.......ZZ..Z............Z.
.....Z.....Z........Z....Z...........Z.......
.....Z..Z....Z...Z..Z..Z.....................
49 37 
....Z..Z...ZZ..Z...Z........ZZ........ZZZ.ZZ....Z
........Z...............Z........................
...Z.Z.......Z.Z.............ZZ.....Z....ZZ....Z.
...Z.......Z..Z.Z..........Z..Z......Z...........
.Z........Z..Z.........Z.Z....Z...Z....Z...Z.....
.....ZZZ.Z....Z..........Z.Z.....Z........Z......
Z.Z...Z..............Z.........Z.................
.......Z.........Z.......Z...ZZ.Z............Z...
..Z........Z.Z.....Z..Z.......Z.Z................
.Z...Z......Z.ZZZ....Z.......Z....Z..............
....Z.......ZZZ....Z.Z.....Z...................Z.
........ZZ...Z.Z.Z...........Z..Z......ZZ........
ZZZ.Z....Z....Z.....................Z............
..Z........ZZ.ZZZ.Z............Z....ZZ..Z.....Z..
.Z...Z.Z.....ZZ.........Z...Z........Z.ZZ......Z.
.Z..............Z.Z..Z.........Z..Z.ZZ.Z.Z......Z
.......Z......Z.ZZ......ZZ..Z......Z...ZZ.....Z..
....Z................Z..................Z..Z....Z
....Z......Z...Z.ZZ....ZZ.Z.Z.....ZZ......Z.ZZZ..
...........Z...............Z.....Z..Z..Z.Z......Z
..Z.ZZ....Z.........................Z.........Z..
Z.....Z.Z...Z..Z...Z.............ZZ...Z...Z...Z..
........Z..Z..ZZ............Z....Z.Z....Z......ZZ
...Z......Z..Z....ZZ.....Z........Z..ZZZ........Z
.............Z.....Z.............Z........Z.Z....
...Z.Z.Z.Z..Z.ZZ.Z..............Z..Z......B......
.Z.....Z.........Z..Z............................
..Z.......Z............ZZ....Z.Z.Z...............
..Z.Z.........Z.......Z...............ZZ......Z..
Z......Z....ZZ..ZZ.Z......Z.......Z....Z.Z...ZZ..
...............Z.............ZZ.Z.......ZZ.......
......Z..Z.....Z.............Z.........Z.....Z...
.Z.A.....ZZ................ZZ.........Z...Z......
..........Z.......Z........Z........Z.Z..........
.............Z..Z..Z.........Z...Z..Z..........Z.
.....Z.............ZZ.........ZZ.....Z..Z..Z.....
.............Z..Z.....Z.......Z.........Z...Z...Z
75 39 
ZZ.Z.....ZZ.............Z.Z.......Z.Z.................Z.......ZZ....Z...Z..
....Z.....ZZZ...Z.....ZZ...............ZZ.Z........Z...............Z.....Z.
.......Z...Z...........Z...Z..ZZ....Z..................Z........Z.....Z..Z.
............Z.....Z.Z.Z...Z.ZZ.........Z....Z.......Z............Z..ZZ..Z..
..Z............Z.................................Z...ZZZ..Z.....Z...ZZ.Z...
...ZZ..Z.....................Z..........Z.................Z....ZZ...Z......
....Z...Z.....Z...............ZZZ...Z..........ZZ.....Z.......Z..Z......Z..
.........Z...Z..Z..............Z..Z.ZZ...BZ..ZZ..Z...Z.Z........ZZ...Z....Z
..........Z.............................Z...Z...Z......Z.........ZZ.ZZ....Z
......Z.............Z...........Z......................ZZ..............Z...
..Z.Z.Z...........ZZZ.Z.........Z..Z....Z......ZZ................ZZZ.Z...Z.
...Z......ZZZ..............Z......Z.Z....Z.....Z........ZZ...........ZZ..Z.
Z..ZZZ.......Z..Z...............Z.............Z.Z......Z...Z...Z..Z..Z.....
...........Z..Z..Z...Z.Z........Z..........Z..............ZZ.Z...ZZ....Z...
Z.Z...........Z.Z.Z.............Z.Z..Z.ZZ.Z.Z..........Z.ZZZ.......Z.....Z.
........ZZ.............Z................Z........Z.....Z.............Z.....
.....Z.......Z.ZZ.Z.Z.....Z..Z.........Z.Z.......Z....Z.....Z...Z........Z.
.ZZ.....Z..Z..Z...........ZZ.Z.Z.......Z............Z.Z..........Z.........
....Z..Z.....Z..........ZZZ...Z.ZZ.....Z........ZZ.........Z..Z............
......Z.....ZZ.Z...Z..Z....Z.....Z.....ZZ...............ZZZ........Z.ZZ....
Z....Z..........ZZ........Z....Z....Z.......Z.....Z..Z....Z.....Z........ZZ
.....Z........Z...........ZZ.....Z..AZ.Z....Z...........ZZ..Z......Z.Z.....
.......Z...Z........................Z..Z....Z........Z.Z.......Z....Z......
Z.Z..ZZZZ........................ZZ..ZZ..Z.............Z.Z....Z...Z.Z...Z..
Z....Z....Z.......Z.......Z.....ZZ..Z...Z..Z..........Z.........ZZ....ZZZZ.
.....Z..Z...............Z.........................Z.Z...........Z........Z.
......................Z.Z..................Z..Z.Z........Z.ZZ........Z.....
........Z.....Z.Z......Z...Z.....Z..Z.......Z.............Z...Z....Z.......
.Z....Z.......Z...........Z.Z...............Z..Z.................Z.....Z...
...Z.....Z....ZZZ.Z....Z.Z.Z.....Z.Z...Z......ZZ.Z......Z...Z..............
......ZZ.....Z..Z.Z...Z..Z......Z.ZZ.......Z.............Z.Z...............
..ZZ......Z.Z.Z...........ZZZ............ZZZ...Z..ZZ.......Z....Z.ZZZ..Z...
........Z.....................Z.....Z..Z....Z...............Z............Z.
.....ZZ...ZZ...Z................Z.Z...Z..................Z.Z.........ZZ..Z.
...Z................Z....Z..Z.ZZZZ..Z...Z....Z....Z.....Z..Z..Z...Z...ZZ...
Z............ZZZ....Z.........Z........Z..ZZ........Z.Z...Z..Z.....Z....Z..
....Z.ZZ......Z.Z.......Z.......Z....Z........................Z..Z...Z.ZZ..
Z.......Z.......Z............Z........Z..Z..Z.......Z..Z.....Z.Z........Z.Z
Z.Z..ZZ.........ZZZ.........Z......Z.........Z......ZZ...Z.....Z..Z....ZZ..
79 72 
Z.......Z...Z...Z..Z.Z.....................ZZ..........ZZ.........Z............
....Z....Z..Z..........Z....Z..Z..Z.......Z.Z.Z.............Z......Z...........
...Z............ZZ.Z................Z..Z..Z...Z...Z.Z.Z.Z......Z...Z...........
..Z...Z.............................Z...Z.....Z..Z.Z...Z..Z.Z.Z.Z..Z..Z...Z....
.Z.......Z...................Z......Z.......Z...........Z..........Z...........
.Z..................ZZ..ZZZ...Z..Z.ZZ.Z.............Z.....ZZ.............ZZ....
Z.A.Z.Z.Z..Z....Z...Z.......Z........Z..........Z....Z....Z...ZZ.Z.............
....Z.....ZZ...............Z.Z..........Z..Z.......Z.............ZZ...Z........
..Z..Z...Z.ZZ..Z.....................ZZ..................ZZ..Z.ZZ.Z......ZZ....
Z....Z........Z...........Z..Z......ZZ................Z.Z......Z.......Z.......
..Z...ZZ.Z.........ZZ.Z..............Z.Z........Z.....ZZ....Z.....Z.Z..Z.......
....Z.................Z....Z..Z..Z...Z.......Z......................ZZ......Z..
......ZZ.Z...Z.Z....Z..........................Z.....Z...Z.............Z.Z..Z..
........ZZ.......Z.....Z.Z.Z...B.......Z...ZZ.....Z.Z..Z...Z...ZZZ..ZZ...Z.....
.....Z.........Z.......................Z.........ZZZ...........................
....Z.....Z.......Z........Z.......Z..Z............Z.Z...ZZ..ZZZ..Z.........Z..
........Z..Z.......ZZ.Z.Z..Z.Z....ZZ...............ZZ.......ZZ....Z.....Z......
.........ZZ......Z....Z.....Z...........Z.....Z.......Z...........Z............
....Z..........................Z.Z......Z......................ZZ.....Z........
........Z...Z.........Z......Z.Z.....Z.....Z....Z...Z....Z.............Z....Z..
..Z..Z.........Z.Z.......Z........Z..........Z...ZZ.Z......Z.......ZZ..........
....Z.Z...Z..........Z..Z........................ZZ....ZZ.Z...................Z
...Z....Z..Z.Z...........Z.................Z............ZZ...........Z.....Z..Z
.......Z.Z...........Z.......Z......Z......Z........ZZ....Z...Z.........Z.Z....
..Z..Z.....Z..........Z.Z....Z....Z..............Z..Z...Z...Z..................
........Z...........Z.Z...........Z..Z.Z...ZZ....Z..Z...................Z......
.........Z.Z......Z....Z..........Z.........Z...........Z..............Z....Z..
.Z..Z..........Z..........Z...............Z.........ZZ...Z.Z.Z.....Z...........
...............Z.Z...Z..ZZ...Z...Z....................Z.Z.......Z..Z....Z......
......................Z...........................Z......Z..................Z..
..Z.ZZ.Z........Z...Z................Z..Z......Z............Z.......Z..........
..Z........ZZ...........Z....Z.Z....Z.........Z...Z...ZZZ.....Z....Z...........
.Z..........................Z....Z..Z...............ZZ....ZZZ....Z..Z......Z...
..........Z.........Z..Z....Z.Z................................................
.........Z....Z...ZZZ........ZZ............Z........Z.Z............Z.......Z..Z
..Z...Z...Z...ZZ..Z........Z.............Z....Z.................Z....Z......Z.Z
Z..Z...ZZ.Z............Z..ZZ..Z...Z..........ZZ.......ZZZ...Z.ZZ..Z..........Z.
...........Z.......Z....ZZ.ZZ.....Z.......Z...........Z..Z....Z.Z.............Z
.................Z..Z.ZZ........ZZ...............Z..........Z...Z.....Z........
.....Z.....Z..Z..Z..ZZ..Z......Z....Z......Z..Z.ZZ.Z.Z.......Z.Z.Z...Z.ZZ....Z.
........Z................Z.....Z..Z.ZZ....ZZ......ZZ....Z................Z.Z...
..Z.......Z..Z..Z...Z...Z...............Z.Z..Z......Z..Z...........Z...Z..Z....
ZZ......Z...Z...........Z...Z..........Z..............ZZ..ZZ.Z..........Z.....Z
.....Z...........Z....Z........Z...ZZ.....Z........Z..ZZ.....ZZ...ZZ..Z..ZZZ.Z.
.....Z....Z....Z.........ZZ..Z.Z.......Z..............Z....Z....Z.Z.Z.....Z....
.......ZZ.....Z.Z.Z.Z.Z.ZZ.Z................Z....Z.........................Z...
.Z..Z..Z.Z.........Z............Z.Z...Z........Z.ZZ..Z.Z.ZZ.Z.......ZZ.Z..Z....
....Z.......Z.................Z.................Z...........Z..........ZZ.Z....
Z.....Z.Z.......Z..Z.Z.Z..............Z.ZZ.Z.....Z..Z...Z..................Z...
..Z...ZZ.....Z............Z..Z.....Z....Z..Z..Z...Z.Z.......Z......Z.Z......Z..
.Z....Z..........Z....Z...........Z.......Z...Z.Z..............Z.Z.Z.Z.Z..ZZ...
.....ZZZ.Z..ZZ..ZZ...........Z........ZZ..Z..Z..........Z...Z....ZZ..Z.........
...........Z....Z..........ZZ.Z.............Z......Z............Z..........ZZ..
..Z....Z.Z...ZZ...............Z.Z....Z.....Z......Z.......Z......Z.............
.....Z............Z..........Z.ZZ.....Z..ZZ.Z........Z.....ZZ....Z......Z......
...ZZ....Z....ZZZ..............Z...Z.Z................Z...........Z..Z......ZZ.
.........Z.......Z.ZZ.Z.......Z.Z...Z........Z...ZZ.Z.Z...Z...Z..Z.............
......Z...Z..Z..Z.Z............Z........Z........Z..........ZZ....Z..Z.......Z.
Z............Z..........................Z.......Z.Z........Z.....Z..Z.Z.Z......
.....Z..Z.Z.......Z................Z.....Z...........ZZ........ZZ..............
Z................ZZ........Z.........Z..........Z.Z.Z...Z.......Z......Z.....Z.
...Z........Z........ZZ......Z.ZZ.....Z.......................Z.....Z...Z....Z.
ZZ.....ZZ..ZZ.................Z.....ZZ........ZZZ.ZZ..........Z..Z...Z.ZZZ.....
Z..........Z......Z............ZZ...........................Z.........Z..Z...Z.
.....Z...Z......Z........Z.........Z..........Z....Z...Z.Z....Z....Z.....Z.Z...
......Z.Z.Z.............ZZ......Z..Z...Z....ZZ.....Z................Z.Z...Z....
.........Z...Z........ZZ.Z...Z.....Z.ZZ..Z.................................Z...
..............Z...Z......Z.......Z.......ZZ.......Z......Z................Z.Z..
..........Z..Z....Z...ZZ............Z......Z......Z..Z..........Z.......Z....Z.
........ZZ..Z.....Z..........Z..ZZ...Z......Z....Z....Z...Z....................
.Z.........Z.Z.......Z.......ZZ.............Z....Z.............................
...Z.............Z...Z.Z...............Z...Z......Z......Z.........Z..ZZ.......
69 76 
..Z...............Z.Z....Z.Z..............ZZ.Z.Z.Z...................
.....................................Z....ZZ.ZZ...........Z.Z..ZZ....
.............Z...Z........ZZZZ....................Z.Z.Z.........Z.ZZ.
.Z..ZZ..Z......Z..Z.Z...Z..................ZZ......ZZ..Z....Z.......Z
......Z..Z...........Z...............Z.Z.....Z.....Z..Z.....Z..Z...Z.
.....................Z.Z..Z.Z..Z.Z..................Z.Z.....Z..Z.....
.Z..........................Z.ZZ..Z..........................Z.......
.Z......Z........Z.....Z..........Z.....................ZZ...Z....Z..
.........ZZ.Z.....ZA..ZZ...ZZ..ZZ....Z.....ZZ.......Z.Z....ZZ....ZZ..
.....................Z........Z....Z..............ZZ.....Z.........Z.
..Z...Z......Z.......Z...............Z..........................Z....
..Z......Z.....Z......Z.....Z............Z...........................
Z......Z....Z.ZZ.....Z.Z......Z.....ZZ.....Z.ZZ..Z...................
Z...............Z.......................Z..Z.......................Z.
ZZ..Z.....Z.....Z....ZZ........Z..........Z.....Z.ZZ..............Z.Z
..ZZ..........Z..........Z..........Z.....Z........Z.Z.........ZZ....
Z.Z.Z..............Z..ZZ...ZZ.....ZZ.......Z..Z.Z.Z.....Z.Z.....Z....
.....Z...ZZ...........Z..Z.Z..ZZ....Z..........Z.Z...........Z.......
...Z.........Z.Z.....Z....ZZ............ZZ......ZZ.Z...Z...........ZZ
Z..Z...Z............Z........Z.Z....Z....Z...Z...Z...........Z.....Z.
.......Z...............Z...........Z...Z............Z...Z............
......................Z......Z.Z........Z..Z.Z.Z...Z...............Z.
.....ZZ........Z.Z..........Z....Z..Z.Z...Z............Z.Z....Z.ZZ...
ZZ.Z......Z..Z...ZZ....Z....Z....Z..Z....ZZ...........ZZ..ZZZ......Z.
.......Z..Z.......Z.....Z.........Z...Z..........Z................Z..
..Z....Z...Z..Z.......Z.Z........Z.Z.ZZ.......Z.....Z........Z...Z...
Z..Z........Z...........Z.Z...........Z................ZZ....Z.....Z.
....Z.....Z..Z.....Z.Z....ZZ.......Z...Z...............Z.........Z...
Z.Z...Z.Z................Z..ZZ...........Z.Z.....Z..Z...Z..........Z.
.ZZ.Z........Z............Z..ZZ...Z...Z....Z..Z.......Z.......Z...ZZ.
Z...............Z...Z........Z.............Z....Z....Z...............
.Z....Z....Z..Z................Z.......Z...............Z.Z.....Z....Z
..............................Z.................Z.Z.Z...Z...Z..ZZ....
.....Z.......Z....................Z............Z....ZZ..Z............
..Z......Z..Z........Z...Z......Z..Z.Z............Z......ZZ....ZZ.ZZ.
.Z...Z........Z.............................Z......Z..........ZZ..Z..
......Z.Z....Z..Z.Z..Z.........ZZ.Z...Z..Z.Z..............Z..........
.............Z.Z...Z....Z......Z.....ZZZ....................Z........
.ZZZZ..Z...Z..Z............ZZ...Z....Z..........ZZ.Z...Z............Z
..ZZ.................Z..Z............Z......ZZ..ZZ.Z...........Z.ZZ..
.....Z.Z..Z.........Z..Z......Z.....Z.Z.............Z......Z.....Z..Z
...Z...Z.Z.....ZZ..........ZZZZ.....ZZZ...Z.....Z......Z.Z..Z.ZZ...Z.
......Z....Z.ZZ.Z.......Z.Z...Z.Z.....Z..Z...ZZ.....Z..............ZZ
...Z.Z...ZZ...Z.....Z.....................ZZ.........................
.................Z........Z.........Z.......Z.......Z..Z.ZZZ...Z..ZZ.
.........Z.......ZZ............Z.Z.Z.Z........Z..ZZ....Z.......ZZ....
.Z..Z................Z..Z.......Z..ZZ............ZZ.Z................
......Z..ZZ.......................ZZ.Z.......Z...ZZ..........ZZ....Z.
.Z.Z......ZZ....Z..Z....Z..Z......Z..Z.Z.Z.........Z...Z...ZZZZ.Z...Z
...................Z....Z...Z........Z...............Z....ZZ......Z..
............Z..Z...Z..Z..........Z.................ZZ...Z............
.....Z..Z...........Z.........Z..ZZ..........Z............Z...Z...ZZ.
..Z..Z...ZZ..........Z..............Z....Z...............Z.Z...Z..Z..
...ZZ.ZZ............Z....Z...B...Z..............ZZ......ZZ...Z...Z...
.Z....Z......Z....Z....ZZ........Z.Z..ZZ............Z...Z.ZZ..Z...Z..
...........ZZ..............ZZ......Z..............Z.Z...ZZZZ..Z......
....ZZZ...........Z...Z....ZZ...Z..ZZ..Z..Z.........Z.....ZZ.Z......Z
Z.Z.......Z.............Z..............Z.Z...Z..ZZ............Z......
..........Z.............Z...Z........Z.......Z......Z...........Z....
..Z.......Z..........Z.Z.....Z..............Z...Z..Z.........Z...ZZ.Z
........ZZ....Z.........Z.......Z....Z.........................Z.....
Z......Z........Z............................Z.Z..ZZ.Z.....Z..Z......
.........Z....Z...........................Z......Z....Z....Z...Z.ZZ..
....Z.............Z......ZZ.Z........Z.Z....Z..Z..Z.........Z...Z.Z..
.Z.Z..Z...Z.......Z.....ZZZ...Z....Z........Z........Z...Z...Z...Z...
...Z..........Z...Z.Z....Z.Z.ZZ..................Z.Z...ZZ.Z.Z........
............Z..Z.......Z.........Z........Z.....Z.......Z..........ZZ
.Z......Z..Z.......Z..........Z.....Z...Z..ZZZ...........Z...........
...........Z..ZZ..Z.............................Z............ZZ......
.........ZZ.Z...ZZZ........ZZZ....Z.Z....Z..........ZZ..Z.....Z......
................Z..Z...........Z...ZZ........ZZ.Z.....Z.Z.....Z......
......Z.Z..ZZZ.........................Z.....ZZZ.......ZZZ...Z.Z.....
..Z..........ZZ..Z..........Z............Z....ZZZ.......Z..Z.Z....Z..
..Z..................ZZ.........Z.......Z.ZZZZZ..Z.......Z........Z..
....Z......Z...ZZ.....ZZ..Z...Z............Z.....Z...Z.Z..Z..........
.Z.Z.Z..............Z.Z.....Z.......Z..........ZZ.............Z......
89 95 
.......ZZ.Z.........Z.........Z.Z..........Z.....Z.Z.Z..Z.............Z...Z......Z.......
ZZ.Z.........Z.....Z.......Z..Z....Z.......Z...Z.Z....ZZ......Z.Z........Z..Z.Z..........
Z......................Z..Z....Z............Z.Z.............Z..................Z.........
....Z.Z.Z.Z.........Z..............Z..Z........Z..........Z.Z..Z.........Z.Z.........Z..Z
.Z............Z..Z....Z....ZZ.Z.ZZ.Z.Z.........Z.......Z....ZZZ.ZZ...Z..Z.......Z........
Z....Z....ZZ............ZZ.......Z..............ZZ...Z...Z.....Z.ZZ.Z.Z............Z.....
.............Z.Z.....ZZ...........ZZ.....ZZ.....Z....Z..Z......Z...Z.Z......Z............
Z....ZZ....Z............Z........ZZ...........Z........Z.....ZZ.................Z......ZZ
........Z.............Z...ZZ.ZZ...ZZ.Z...Z......Z.Z..Z........Z.Z....Z...ZZ..Z.Z.Z.......
...........Z.Z..........Z.............Z..Z....Z.......Z......Z.Z......................ZZZ
............................................Z..Z....Z.Z........Z...Z........ZZZZ.........
............Z....Z.Z......Z.........Z.........Z.Z.............Z..Z......................Z
..........Z..................Z........Z..Z..Z........................Z.Z.......ZZ.Z......
...Z.........Z.................Z..........ZZ.Z.............ZZ...Z....ZZ..Z..Z.....Z.....Z
...Z.Z.......Z..ZZ.....Z....Z.Z.......ZZZZ...........Z..Z..Z....Z..........ZZZ.Z..Z...Z..
.Z......ZZ..Z............Z.Z.Z....Z.....Z....Z.....Z........Z.........ZZ....Z...Z.Z...Z..
.....Z...Z.Z......Z.Z...........Z.....Z...........Z..............Z...........Z..........Z
......Z.....Z..............Z.ZZ..Z...Z.............Z....Z.Z.Z......Z.....ZZ..............
Z..Z....................Z...Z............Z.......................Z.......................
.........Z........Z...Z....Z..........ZZZ.Z.................Z..........Z.ZZZ.........ZZZ.
Z..........ZA....Z..................ZZ..ZZ............ZZ........Z...Z.Z.Z.............Z.Z
ZZ.Z....Z..........Z........Z....Z..ZZ..Z...Z.Z.....Z......Z......Z..ZZ......ZZ....ZZ....
.ZZ.Z...Z....ZZZ.Z....Z...ZZ............Z......Z..........Z...............ZZ.......ZZ..Z.
.....Z.........Z...ZZZ.Z.ZZ.......ZZ....Z.....Z.Z..........Z.Z........Z.............Z...Z
.Z....Z......Z...Z.........ZZ........Z.Z...........Z..............Z.Z........Z...........
.............Z...............Z......Z.....Z..Z....Z....Z.Z..........ZZZZZ..ZZ...Z.Z......
.Z............Z....Z..Z..........Z..............Z..........Z.Z......B.......Z..Z.....Z.Z.
ZZ.......Z....Z..Z...Z.ZZZ..Z...Z.......Z....Z....Z...Z.......Z..........Z.Z.....Z.......
..............Z......Z.........Z.....ZZZZ..ZZ...Z...........Z...ZZ......Z.........Z...Z..
..Z..........................Z..........ZZ.....Z.Z.Z....Z..Z.......Z.............Z.......
....................Z............Z....Z................Z.......Z......Z.Z...Z..Z....Z.Z.Z
.....................Z.ZZ...ZZ.Z.....ZZ.Z.........ZZ.......Z.....Z...Z.......Z...Z.....Z.
.......ZZ...Z..ZZ......Z......Z..Z...ZZ....ZZ.............Z.................Z....Z...Z.Z.
...............................Z..Z.......Z.ZZ.Z...................Z....Z.........Z.ZZ...
Z............ZZ..Z........Z.Z........ZZ......Z.Z...........Z..Z.......Z.........Z..Z.Z...
.....Z.Z.ZZZ.....Z.Z.......Z..Z..Z.Z.....Z.Z............Z...Z.......Z......Z.............
Z...Z....Z...............Z..Z....Z....Z......ZZ.....Z.......Z...Z....Z........ZZ..Z....Z.
ZZ....ZZ.Z.ZZ.Z...............Z..ZZZ..........................Z...Z...Z..........Z..Z....
Z............Z..........ZZZ.Z........Z..Z.............ZZ..............Z..........Z.......
.ZZ.........................ZZ.ZZ......Z..Z.ZZ.......Z...Z....Z........Z.....Z...Z.......
......Z....Z......Z..Z...ZZ.....Z..ZZ..Z.......Z..Z.......Z.....................Z.....Z.Z
....Z.Z..........Z.Z..............Z..........Z.........Z..........Z..Z.............Z.....
....Z.......Z...Z....Z.Z.Z.Z...........Z.Z.Z....Z.ZZZ...................ZZ......Z.Z......
..........Z....Z................ZZ..Z...ZZ..............Z..Z...Z.Z..........Z............
..........Z..Z......Z...Z....ZZ....Z......Z...Z....Z.Z...........Z..........Z..........Z.
.Z.............Z.ZZ.....Z..ZZ..Z.........Z........ZZ....Z......Z......ZZZ................
................Z.Z.Z.Z........ZZ.....ZZ......Z.........Z...Z.Z.Z......Z.Z...............
.......Z......................Z..............ZZ....Z...Z.Z..Z......Z......Z..........Z.Z.
...Z.....Z..Z...Z..Z..Z.Z.......Z.....Z..............Z.Z.........Z.....Z..Z.Z.Z.Z.Z.....Z
...Z.........Z...Z.................Z.....Z..........Z..........Z........Z...Z....Z..Z..Z.
........Z.Z.Z.....Z..............Z.....Z......Z.....Z.Z..Z....Z....Z..Z.......ZZ.Z..Z....
.Z......Z......Z.Z.....Z................Z.....Z.........Z..Z........................Z....
.......Z....Z......Z...Z.....Z...ZZ........Z...............Z.Z.......Z.......Z.......Z...
....Z...Z...........Z................Z..................Z.Z...Z..ZZZZ............Z.......
.........Z............Z.....Z....Z.ZZ............Z...Z....Z...Z.ZZZ...Z.ZZ.Z..Z......Z...
.ZZ............Z..Z.......Z........Z..Z..Z...Z..Z........Z..Z........Z.........Z.........
Z.....Z....Z.Z.ZZZZ.....ZZ...ZZ......Z.....Z......Z..Z.....Z........Z.............Z...Z..
Z......Z...Z..Z.....Z....Z.Z...ZZ.........Z..ZZ....Z..ZZ........Z..........Z....Z........
..Z.Z.....Z.............ZZ.....ZZZ.....ZZ..Z......Z..ZZZ..Z..Z..Z.ZZ.....Z....Z....Z.....
.....Z.....Z.Z.....ZZ.............Z..Z...Z....Z.ZZ....Z...Z....Z..Z......Z............Z..
.........Z...ZZ........ZZ...ZZ...........Z.....ZZZZ.ZZ....ZZ...Z............Z.........Z..
...Z....Z..Z......Z......Z.......Z...Z.Z.ZZ..Z.Z......Z...Z...Z.Z...Z.Z..........Z...Z...
............Z.ZZ......Z......Z.....Z......Z.........Z....ZZ..Z..Z..........Z......Z.....Z
..Z..Z..Z.....Z..ZZ............Z.Z..........Z.....Z....Z....Z..ZZ...........Z.....Z....Z.
....Z.........Z....Z.........Z.........ZZ..Z..Z.............Z.ZZ...........Z..........Z..
.......Z...Z.Z...........Z.......Z........Z...Z.....Z..Z.......Z....Z.Z......Z...........
.ZZ....Z...................ZZ.........ZZ....ZZ....Z..........Z..ZZ...Z.Z.................
..........Z...........Z........Z.......Z.Z.....Z..Z.....ZZ.Z..Z........Z...Z.....Z.......
......Z.......ZZ..........Z......Z...........Z.Z...Z.........ZZ..Z................Z..Z...
.Z.............ZZ......Z..............Z..........................ZZZ........Z..Z..Z..Z...
................Z.....ZZZ.Z...Z..Z..Z............................Z..Z.Z...ZZZZ...........
.................Z......Z.........Z...Z...........Z........Z..Z.....................Z....
...............ZZ..Z.......ZZ.......Z.....Z...........Z.Z.......Z.......Z..Z........Z..Z.
.......................Z............Z.......Z.Z.....ZZZ..Z..........Z..Z....Z..Z...Z...Z.
......Z..................Z...............Z..Z....Z.Z..Z..Z.................Z......Z...Z..
...Z.........ZZ...ZZ...........................Z........Z....Z....Z..........ZZ..Z.Z....Z
.....Z......Z....Z.......Z..Z......ZZ.Z.Z....Z...........Z.Z....Z...Z.......ZZ.Z......Z..
.........Z..........Z...Z................Z.Z........Z.Z..........Z.....................Z.
..ZZ.............Z...ZZ.Z...........Z..........ZZ....Z.....ZZZZ...........Z.Z.........Z..
.ZZ.ZZ.Z.............Z......Z............Z....Z...............Z....Z....Z.............Z..
...Z........Z..ZZ.....Z..........Z......Z......................Z..........Z.Z.Z....ZZ....
......Z...Z.Z.ZZ..........Z.........Z..ZZ.......Z..Z......Z.....Z...........ZZ...........
Z.Z..Z.......Z.Z.....ZZ....ZZ......Z....Z.....................Z........ZZZZ...........Z..
...Z...Z.ZZ.....Z.Z...Z..ZZ.......Z.......Z...........Z.........Z.......Z...Z...Z......Z.
Z.....Z.Z..Z.Z.............ZZ.........Z....ZZ.........Z...............Z..............Z...
.................Z.ZZ...Z..Z............Z.Z.Z.......Z..ZZ..........Z.......Z.....Z..Z.Z..
...........Z.Z....................Z......Z......Z.Z..ZZ.......Z.....Z......Z.............
....Z.Z......Z.....ZZ...............ZZ.....Z......Z.Z..Z..Z.....Z..Z........Z....Z.......
.....Z.........Z......ZZ.......Z.Z........Z..Z.......Z.Z...Z.Z.Z....Z.ZZ.ZZZ.............
.Z.....Z...Z.....ZZ........ZZZ...Z.ZZ..ZZ.Z.ZZ.................Z.......Z....Z..Z..Z...Z.Z
..Z.....Z......Z........Z..ZZZ...Z...Z........Z.Z....ZZ..Z...Z...Z......Z.Z..............
.......Z..........................Z.Z....ZZ..Z........Z..................................
....Z..Z.Z.Z.......Z..........Z..Z.....ZZ.........Z..Z.........Z.Z.Z.....Z...............
........Z...Z.Z.......ZZ.Z........Z....Z..............Z.Z...Z.....Z.....Z................
.........Z..Z.........Z..Z...........Z...ZZ.........Z.......Z.....Z..Z..............Z....
74 78 
.....Z.............................Z.....Z..........Z.Z............Z......
...Z...ZZ......Z.ZZ......Z......Z...........Z.....................ZZ......
.......ZZ..Z....Z...Z...........Z.......Z.......Z....Z..Z.................
...ZZ....Z......Z....Z....Z........Z..............Z..........Z..........Z.
Z.Z...Z...Z.Z....Z.........ZZ.....Z..........ZZ...........Z...Z...........
.ZZ......Z...........Z.......ZZZ.ZZ....Z....ZZ..Z...Z...............Z..ZZZ
......Z.....Z.....Z..........Z.......Z......ZZ....Z.ZZ...........ZZ.......
.Z......Z................ZZ.....Z........Z..........Z...Z.....Z...........
.....Z..Z..Z.ZZ.Z....Z....Z..ZZ..Z.....Z....Z.Z........ZZ..........Z......
..........Z......Z......Z...ZZ..Z....Z...Z.Z.....Z....Z.ZZ.Z..............
....Z............Z.Z...........Z...Z...........ZZ......ZZ...Z.Z.Z..ZZ.Z..Z
.......Z....ZZ...Z.Z........Z..Z...ZZ........................Z...Z....Z...
...........Z....Z.....Z.........Z.Z.........Z.....Z..........Z......ZZ..ZZ
....Z....Z...Z.........ZZ.Z.....ZZ.........Z.......Z..Z............Z......
..ZZ.ZZZ........Z.......Z.......Z........Z...Z.Z....Z........Z......Z..ZZ.
.............Z....ZZ.......Z....ZZ...........Z.Z.....ZZ.................Z.
...........Z.......ZZ...Z.........Z..................Z......Z...Z..Z..Z...
.......Z........Z...........Z.......Z.Z........Z..........Z...............
Z.....Z....Z.....Z.Z..Z......Z...........Z..........Z....Z..Z.Z......Z....
.Z.......Z..Z...Z.Z......Z.....ZZ.....Z....Z..............Z...........ZZ..
.....Z....Z.Z..Z..Z.........Z...Z.Z..Z........ZZ.....Z........ZZ.ZZ....Z..
....Z.................Z.........................Z........Z............Z...
ZZ....................ZZZZ....Z.Z..Z..Z....................Z.Z..Z.Z.......
....Z...ZZZ..........Z.....Z.......Z....ZZZ.............Z..........Z......
.........Z.........Z...Z..Z....Z.....Z....Z...Z..ZZZ..Z...................
Z............Z...Z.ZZ.Z...Z...Z.....Z....ZZ..Z..........Z....ZZ...........
.ZZ.........Z....Z.Z.....ZZ....Z.....Z......Z........Z..Z.....Z.......Z...
............Z....Z..............Z.Z......Z.....Z.ZZ...............Z......Z
.Z......Z....Z....Z...ZZZ...............Z....Z....Z....Z.......Z.Z.......Z
..........Z.......Z...Z......Z..Z...Z.................Z.....ZZ..Z.......Z.
...Z......Z........Z........Z.Z..Z.Z.Z.....................Z.Z..ZZZZ..Z...
...................Z......Z.................Z......Z.Z...................Z
.......Z........Z......Z.....ZZ.......Z....Z.Z.............Z.Z.......Z....
Z......Z..Z......ZZ....Z..Z..........Z...................ZZ....Z.Z...ZZ.Z.
.Z.Z......Z...Z........Z.................Z.........Z...Z....Z.Z..Z........
.......Z...Z....Z.Z.ZZZ..ZZ.ZZ...Z..........Z.Z....Z..Z.Z...........ZZ..ZZ
...........Z.....ZZ.Z....Z.Z.Z.......Z.Z......................Z.ZZ...Z....
.ZZ.Z........Z.ZZ.Z.....Z...Z.....................Z..Z...........Z........
Z............Z.........Z..Z...Z.Z.ZZ......................................
...Z..................Z....Z.......ZZ....Z.Z............Z....Z.......Z....
........................Z.....Z...Z......Z....Z...Z............Z.........Z
...Z.Z.Z....Z......Z.Z......Z.Z...........Z.Z....Z......Z..Z..ZZ...Z..Z..Z
....Z....................Z......Z......Z....Z.....Z....Z..ZZZ...Z.........
.....Z..Z..Z....Z.ZZ...................Z.......Z......Z..Z.......Z........
..Z.Z.Z.Z.....Z.................Z.....Z..Z........Z.....Z.....Z........Z..
..ZZ.................Z.....Z..Z.....Z.Z......Z.Z..Z...................Z...
....Z...........Z....Z.Z..........Z...Z..Z...ZZ...Z..Z..Z..........Z.....Z
..................Z...Z..Z.Z.Z.Z....Z.......ZZ.......Z..Z...........Z....Z
.Z....Z..Z......Z.............Z......Z.....Z....................Z..Z.Z...Z
Z......Z....................................ZZZ...ZZZ.................Z...
Z..Z...........Z...Z........Z...Z...ZZ...Z.........Z.Z.Z.Z.ZZ..Z....Z..Z.Z
........Z...Z...ZZZ........Z......Z....Z.......Z.....Z....Z...Z..Z........
.Z.....Z.Z....Z.............Z.....Z.Z.....Z...Z.Z.....Z....ZZ...Z.........
........Z..Z.Z...Z..........Z...Z.....Z.....Z.....Z.................Z.....
...Z..Z........Z.....Z..Z...Z..........Z.........Z.Z...Z.....Z...Z....Z...
Z...Z.......Z..Z..............Z....................Z.....Z.............Z..
.Z...............Z..Z...............ZZ...........ZZ........Z...ZZ.Z.Z..Z..
.Z..Z..Z......Z...Z..........Z...ZZ..................Z........Z...Z..Z....
......Z..............ZZ..Z.Z..ZZZ..Z...Z......................Z.......Z...
............Z.............Z..Z.....Z.....ZZZ.....Z.Z...ZZ..Z......Z.......
Z.Z..Z......ZZ.Z.....Z.Z...............ZZ..Z.Z.......ZZ...................
..Z.......ZZ.Z.Z.Z.....Z......Z.Z..Z......ZZ......Z..............Z....Z...
.............Z..........Z....Z..............Z............Z........Z..Z.Z..
Z.....Z.Z...ZZ..Z.........ZZ....Z..........Z.................ZZ....ZZZ....
..ZZ..Z...ZZZZ..Z......Z.......Z.Z.Z....Z.........Z....Z.....ZZ.........Z.
...Z....Z.ZZ.Z............ZZ..ZB.Z....Z.............Z.........Z...........
........Z..Z.Z.Z...Z.......Z.Z..Z..............Z..Z.Z....ZZ.....Z..Z......
......Z....ZZ.....Z........Z.....ZZZ..Z...ZZZ........Z.Z.Z.Z..ZZ.ZZ.ZZ...Z
....Z.ZZ..Z.....................Z...................Z.......Z.....Z......Z
.Z.Z.Z....Z..Z.....Z....Z.......ZZ...Z.......Z.....ZZ.....Z...Z.Z..ZZZZ..Z
...................Z.Z....Z..Z.......ZZ..Z..Z.Z.....Z..Z..Z..Z.....Z...Z..
...Z.....Z.Z.....Z..............Z...ZZ...Z......Z...Z.Z...Z..............Z
ZZ......Z.................Z......Z...Z.Z.Z..Z...Z.........Z..Z.....Z......
Z....Z.......Z...Z.....Z....Z...A...Z..Z.Z...Z...Z...Z...Z....Z.Z..Z...Z..
...........Z..ZZ....Z............Z......Z.Z.........Z.......Z..Z..........
.ZZ......Z..........Z......Z..Z............Z...Z....Z.Z..Z......Z...Z.ZZ..
.........Z.Z...ZZ.........Z.ZZ..Z....Z....ZZZZ....................Z..Z.Z.Z
......................Z..Z..............Z.....Z.Z.Z...Z...Z.....Z...Z...ZZ
83 54 
.Z....Z.....ZZ..Z....Z.............Z.............Z...Z...ZZ.....Z.........Z...Z....
Z.........Z.....Z.......................................Z....Z.Z...........Z.Z.....
Z......Z.......Z......................Z...................Z...ZZ............ZZ...Z.
.....Z....Z..Z.................Z..........Z..........Z.Z.Z..........Z.....Z.....Z..
..ZZ.......Z........ZZZZ...Z.......Z.......ZZ............ZZ...Z..Z.Z...........Z...
..............ZZ..Z.Z........Z.....Z.Z.........Z...Z...Z....Z....Z.................
.....Z...................ZZ........................Z........................Z......
.................Z..Z...............Z...................................Z.Z........
.......Z.Z......Z.Z...........Z....Z..........Z......Z.............Z..ZZ..........Z
.....Z...........Z............ZZ.Z..................Z..Z.......Z...........ZZ....Z.
.......Z......Z...Z...Z.........Z...Z.......Z.Z......ZZZ.....Z...Z..Z............Z.
Z..Z.....Z....ZZ....Z.Z....Z.....Z......Z.Z..Z...................Z.Z.......Z..Z...Z
.................Z.....Z......Z....Z......Z........Z..Z.....Z....................Z.
..ZZ..Z..Z...............Z....Z....Z.......Z..........Z.Z.Z......Z.Z...............
Z.Z.....ZZ....Z.........ZZ.....Z..Z........Z...Z.....ZZZ..........Z.Z.............Z
.................Z........Z..Z...Z..Z.........Z...Z..........Z.....Z..ZZZ.....Z....
....Z..........Z.Z.................Z.....ZZ....Z.Z.......Z..ZZ.....................
....ZZ.........Z.................ZZZ.........Z.....Z...Z...Z......Z...Z..Z....Z.Z..
...Z.................Z.....Z.ZZ..........Z..............Z.......ZZ.Z.....Z...Z...Z.
.Z........Z........Z..Z.....Z.....Z...........................Z....Z.Z.......Z.....
..Z......Z.............Z.....Z..Z..Z.......Z.Z..Z.Z......Z................Z...Z..B.
.......ZZ.....ZZZ............Z............Z.......Z.Z.....Z...Z..Z.................
ZZ.....ZZZ..Z..Z......Z....Z...Z.......ZZ.Z........Z.Z.....ZZ..Z.......Z....Z......
.....Z....Z....Z.................Z...Z..Z.....Z.....ZZ.ZZ.Z..Z....Z.......Z...ZZ.Z.
ZZ.Z.Z.Z................Z.......ZZ.Z..............Z..Z...Z.....Z......Z......ZZ...Z
......Z...Z.........ZZ..............Z..............Z.......Z..Z........Z...Z...Z...
.Z.......Z.........Z.............Z...ZZ.Z.........Z....ZZ........Z........Z...ZZ..Z
.............Z............Z..Z.....Z....ZZZ.......Z..Z.Z..........Z....Z.......Z...
.....Z....Z..Z....Z........Z.....Z.Z..........Z..Z.Z..Z........Z..........Z.Z.Z...Z
Z..Z..Z..Z........Z.................Z...............Z............Z...Z...Z.Z.......
.Z..Z..ZZ.....ZZZZ.......Z...Z.Z....Z.......Z..Z.........ZZ...Z...Z.......Z........
Z.Z.Z..Z.....Z...........Z....Z...........Z........................Z.Z.....Z.......
..........Z.....Z...Z.Z..Z....Z...Z..........Z........Z.......Z.Z....Z.....ZZ......
..........Z....Z...Z.....Z...Z..Z..............ZA......Z.........Z....Z...Z.......Z
.........Z.Z........Z.............Z..Z....Z.Z.....Z...........Z....Z...Z...........
........Z...ZZ....Z.......Z....ZZ..........Z.Z......Z...............Z..Z...........
.......Z...ZZ.Z............Z......Z..ZZ.ZZZ.ZZ.....Z....Z..Z......Z.ZZ.Z..Z........
......Z..Z.....Z..Z....Z..........Z...Z......Z.......Z.........Z......Z..Z......Z.Z
.Z.....Z..............Z.Z.....Z............Z...........Z...Z..Z.ZZZZZ..............
................Z..Z.Z.....Z........Z................Z.............Z.Z......Z......
.....Z.Z.......Z....................Z...Z......Z.................Z..Z....Z......Z..
.Z......Z...Z....Z......Z.....Z..Z......ZZ........Z........Z........ZZ...Z.....Z..Z
...Z....Z......Z....Z........Z...........Z.....Z..Z.....Z...............Z.....Z....
.......Z..Z...Z..ZZ..........Z...........Z.........ZZ......Z...Z..Z.Z...Z.......Z..
Z.ZZ.....Z.Z...................Z.......................Z.Z.....Z...........Z...Z...
..............Z..Z.....Z........Z....Z..Z.................Z........Z...Z.......Z..Z
.Z.......Z......Z..Z.........................Z.................Z...Z.......Z.......
ZZ.Z........Z...Z..Z...Z.Z.....Z.ZZZ..Z........Z.Z..Z.....Z........Z....Z...Z......
.....................Z....................Z.......Z...ZZ......Z........Z.Z.........
Z...........ZZZ................................Z...............................Z..Z
........ZZ..Z.Z...Z.Z........Z..Z..................Z.....Z.....Z...Z.............Z.
.....Z........Z..........Z...Z.Z..Z...ZZ....Z.............Z.......Z..Z...Z.........
....Z........Z..ZZ.......................Z....Z..Z.........Z..Z.Z......Z.Z.........
.....Z.....Z.......ZZZ.Z.Z.ZZ.......Z.........Z..Z.....Z.........................Z.
82 90 
........Z.Z....ZZ......................Z.Z..............ZZ...Z....Z......Z.Z.....Z
...Z..Z...........ZZ.Z...Z.Z.ZZ.....Z....Z.Z..Z...............Z..............Z..Z.
....ZZ...Z.Z.....Z......Z....Z.Z.....Z.......Z...Z............Z......Z.Z........Z.
.Z.Z..Z....Z....Z...Z....Z....A.Z...Z.Z...............Z..Z.........Z.ZZZ..........
.....ZZZ...............ZZ...ZZ.....................Z.......Z......Z..........Z....
....ZZZ......Z...Z.ZZ......ZZ.Z.............Z..Z....ZZ.........Z......ZZ....ZZ...Z
............Z....Z......Z.Z.Z.......ZZZ.....Z..........ZZZ........................
.Z.....ZZZZ....Z.................Z............Z...Z...ZZ.Z..Z....Z....Z..Z.Z......
.Z...Z.Z........Z..Z....Z.....ZZ.Z......Z..Z...ZZ...Z...............Z.............
..........Z.Z....Z......Z...........Z..Z.....Z.Z.Z..Z..Z............Z...Z..Z.Z....
...Z............Z...Z............ZZ...........Z.....Z.Z.Z..Z.......Z.......Z....Z.
...Z.......ZZ...Z..ZZ..Z...Z..................Z....Z......Z..........Z..Z...Z.....
.........ZZ..Z.Z...Z......Z.Z...Z.Z.Z.Z.....Z........Z......Z.....................
.....Z..ZZZ.....ZZ.......Z............Z......Z......Z.......ZZ.Z...Z.Z..ZZ..Z.....
..............Z......Z...Z..ZZ.Z....Z..................Z......Z....Z.....Z......Z.
Z...Z.Z.ZZ............Z...Z.Z....Z..........Z.Z.......Z.....ZZ...Z....Z..........Z
.Z.....Z.Z.......Z..Z.Z.....Z........ZZ........Z.Z.Z....Z.Z.Z.Z.Z......ZZZ....Z...
.Z................Z..ZZZ...........Z.Z....Z...Z.................Z.................
.ZZ..ZZ........Z....Z...Z...........Z.........................ZZ..Z..ZZ.........Z.
Z.......Z..............................ZZZ......Z.ZZ........Z...Z.......Z.........
.........Z........ZZ...Z....Z....Z..................Z.Z..........Z.Z...Z..........
Z.....Z.ZZZ..Z.Z..Z.....Z......................Z....ZZ..................ZZ......Z.
Z........Z...Z.Z..............Z....Z..........Z.....Z.Z..Z.....Z...........ZZ.....
...Z....ZZ..Z.Z.Z..Z....Z..Z..........Z.ZZ.......Z.........Z..........Z.....Z..ZZ.
...Z........Z..........Z...Z....Z...............Z..Z..Z..Z...Z.......Z......Z..B..
.Z..Z.....Z...Z...........Z..........ZZ..................................Z......Z.
.Z......ZZ.......Z......Z...................Z...Z....................Z....ZZ.....Z
.....Z....Z...Z......Z.ZZZ.Z......Z....Z........Z.Z...Z.....Z.....Z..ZZ.Z.Z.......
.........Z.Z........Z...Z.......Z.Z...............................Z..Z..Z....ZZZ..
...Z...Z.......Z.....Z..................ZZ..Z...........Z.Z........ZZ.Z......Z....
............Z.Z..........Z.ZZ.......Z.................Z...........Z..Z.....Z......
Z..Z......Z.....Z.ZZ...........Z...Z.....Z...Z...........Z..Z....Z..Z...Z.........
..Z...ZZ..Z..............Z...Z..........Z..Z........Z..........Z...Z......Z.Z.Z...
....Z.....................Z...Z.Z......Z...Z...Z................Z.Z.Z......Z......
..Z........Z............Z.......Z......Z.........Z.Z.......Z....Z........Z...Z....
Z.Z..Z.Z...Z...Z...Z...ZZ....Z...........Z....Z...........ZZ.........ZZ....Z.Z..Z.
.....Z.Z........Z.Z....Z.....Z............Z...Z...Z..Z...Z.Z.....Z..Z..Z...ZZ.....
........Z.Z.........Z.Z.....ZZZ.Z....Z......Z..Z...Z.....Z..Z............Z........
.........Z.....Z..ZZ..Z...ZZ.......Z...Z.....Z....Z..Z....Z...................ZZ.Z
.......................ZZ....Z.Z..Z......Z..Z..........Z....Z...ZZ.Z..Z...Z.......
ZZ.....Z.Z.....Z............Z....Z..Z.ZZ........ZZ..Z.Z.ZZ....ZZ....ZZ............
.Z.Z.......Z.....Z........Z.Z.ZZ.................Z....ZZ...Z...ZZ........ZZ.......
...Z.Z...Z..Z......Z..Z...Z....Z.Z.....Z.Z...Z.ZZ......Z......................ZZ..
....Z...Z............Z...ZZ.Z.ZZ.........Z....Z.............Z.......Z.............
.Z......Z...........Z.......Z...........Z...............Z.......Z..........ZZ.Z.ZZ
.....ZZ...........Z..Z.Z...Z..ZZ.Z.Z..Z..........ZZ.......Z......ZZZ..Z..Z..Z.Z...
.....ZZ...Z.......Z....Z..Z..Z......Z.Z..............ZZ.Z..................ZZ.....
ZZ.....Z...Z...........Z...........Z.Z....Z...Z............Z......ZZ......Z.......
..ZZ.....Z............Z..Z..Z.....ZZ.....Z......ZZ........Z..ZZ..Z....ZZZZ...Z....
ZZ........Z..Z.ZZ.Z.....ZZ.Z.Z.Z...ZZZ.........Z.......Z......ZZ...Z.Z...Z......Z.
..............Z.Z.Z.........Z.....Z...........Z.....Z.Z........Z..................
.Z.ZZZ......................Z.Z...................Z...Z...............ZZ.Z........
........Z.............Z..........Z.....Z....Z....................Z......Z.Z.......
........Z..Z.Z..........Z..Z.....Z......Z.........ZZ....Z.Z......Z........ZZ......
.ZZ....Z...Z.Z..Z.....ZZ........Z..Z.....ZZ....Z.........ZZ..Z.ZZ...Z....Z.Z.Z....
Z...............Z...........Z..Z...Z.....ZZ.Z................Z.....Z.........Z....
..ZZ...ZZ........Z....Z...Z..Z..........ZZ.............Z.............Z.Z..Z.......
.......................ZZ........Z.....Z.....Z........................ZZ..........
......Z..Z....ZZ.................Z...........Z.Z................Z......Z..ZZ..Z...
.....Z........ZZ.....................ZZ..ZZ....Z.....ZZZ.Z.......Z....Z...........
....Z....Z...........Z....Z......Z..ZZ.ZZZZ........Z....Z...........Z.............
.......Z.........Z...Z.......Z...Z............................Z..Z.......Z........
......Z...................Z.Z.....Z....Z.........ZZZ...Z.......Z.ZZ...Z.........Z.
.Z......Z.........Z.Z.........Z.ZZ..ZZZ....Z.Z.......Z.............Z....ZZ.Z......
.Z.Z...........Z....Z............Z...........Z...................Z.........Z.Z....
........Z.Z..Z.Z.....Z.Z.....Z....Z.Z...Z......Z...Z.....Z....ZZZ.........Z..ZZ...
.Z......ZZ.....ZZ.......Z....Z...................ZZ..........Z...Z......Z..Z......
....Z........................................Z........ZZ..Z....Z........ZZ.......Z
....ZZ.ZZZ....Z....ZZZ....Z..ZZ..Z............Z.......Z......Z.Z.Z....Z.....Z..Z..
......................ZZ.....Z.....Z......ZZ.Z..Z......ZZ...........Z.Z.....Z....Z
..Z..ZZ....Z.Z.....ZZ......Z...Z.......ZZ.Z......Z.....Z...Z..ZZ..ZZ......Z.......
....Z..Z...Z.....Z..ZZ.Z.....Z....Z..Z........Z......Z............................
....Z..Z...Z........Z..Z.......ZZ.......Z...........Z.....Z.Z.....................
...Z......Z.....Z......Z......Z..Z.Z.......Z.ZZ.Z........Z..Z.......Z...Z..Z.Z....
.Z............ZZ..Z.Z......Z....Z...Z......Z....Z......Z....Z.................Z.Z.
...Z....Z....ZZ.......Z.Z...Z...ZZZ.Z..........Z....Z...Z.......Z....Z...Z........
...............Z......Z..Z..Z.....Z......Z....Z.........Z......Z....Z..Z..........
...ZZ......Z...Z.........Z.Z...........Z.....................ZZ......Z...........Z
.....Z.........Z........Z........Z...Z.......Z.........ZZ.Z...................Z.Z.
..Z...ZZ..........Z.................ZZ.Z.............ZZ.................Z......Z..
ZZZ.........Z.........Z...........ZZ......Z......Z...........Z...ZZ.Z.......Z.....
.Z.Z........Z...............Z........Z..ZZ....Z..ZZ......Z......Z......ZZZ........
.........ZZ..Z.......ZZ....Z.......ZZ........Z....Z.........Z.Z...................
..........Z.Z..ZZ..ZZ....Z.Z....Z...Z....Z..........Z..ZZZZ.Z...Z.Z.Z...ZZ.Z.Z...Z
.....Z.Z....Z..Z.Z..Z..Z....Z..Z.Z...Z....Z.......ZZZ.Z.....Z..Z..Z.....Z..Z....Z.
.......Z..Z..Z.ZZ..Z.Z...Z.Z.....Z...Z....Z.....Z........Z...Z.......Z.....Z.....Z
.......Z...........Z...Z.........ZZ.Z.Z.Z......Z...........Z..Z....Z..........Z...
..Z.....ZZ..........Z...........Z......................ZZ.Z.........Z...........Z.
........Z..Z........ZZZ.Z.Z.......Z.........Z.Z.................Z......Z.Z.ZZ...Z.
..ZZ...ZZ.ZZ.........Z.......................Z......Z.......Z.Z........Z.ZZ.....ZZ


*** output ***
1
4
1
2
3
2
2
2
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1


*** code ***
#include <iostream>
#define MAX_N 105
#define INF 1000000
using namespace std;

int map[MAX_N][MAX_N];

int N, M;
int Q[MAX_N * MAX_N];
int front, rear;

int dy[] = {0, 1, 0, -1, -1, -1, 1, 1};
int dx[] = {1, 0, -1, 0, -1, 1, 1, -1};
int dy1[] = {-2, -2, -1, -1, 1, 1, 2, 2};
int dx1[] = {-1, 1, -2, 2, -2, 2, -1, 1};
int eR, eC;

void bfs(int r, int c)
{
	Q[0] = r * MAX_N + c;
	front = rear = 0;
	int nR, nC;
	while (front <= rear) {
		r = Q[front] / MAX_N;
		c = Q[front++] % MAX_N;
		for (int d = 0; d < 8; d++) {
			nR = r + dy[d];
			nC = c + dx[d];
			if (nR < 0 || nR >= N || nC < 0 || nC >= M) 
				continue;
			if (nR == eR && nC == eC) {
				map[nR][nC] = map[r][c] + 1;
				return;
			}
			
			if (map[nR][nC] > map[r][c] + 1) {
				map[nR][nC] = map[r][c] + 1;
				Q[++rear] = nR * MAX_N + nC;
			}			
		}
	}
}

int main(void)
{
	freopen("sample_input.txt", "r", stdin);
	int test_case;
	int T;
	char tmp;

	cin >> T;
	int sR, sC;
	for (test_case = 0; test_case < T; ++test_case)
	{
		cin>>M>>N;
		for (int i = 0; i < N; i++)
			for (int j = 0; j < M; j++) 
				map[i][j] = INF;

		for (int i = 0; i < N; i++) {
			for (int j = 0; j < M; j++) {			
				cin >> tmp;
				switch (tmp)
				{
				case 'Z':
					map[i][j] = -1;
					for (int d = 0; d < 8; d++) {
						int xx = i + dy1[d];
						int yy = j + dx1[d];
						if(xx >= 0 && xx < N && yy >= 0 && yy < M && map[xx][yy] == INF)
							map[xx][yy] = -1;
					}
					break;
				case 'A':
					sR = i;
					sC = j;
					map[i][j] = 0;
					break;
				case 'B':
					eR = i;
					eC = j;
					break;
				default:
					break;
				}
			}
		}

		bfs(sR, sC);
        
		int Answer = map[eR][eC] == 1000000? -1 : map[eR][eC];
		cout<<Answer<<endl;
	}
	return 0; 
}