TWOBISOP - TWO BISHOPS

You are given a chess board of order 8x8 with exactly 2 bishops placed on it. Print "Yes" if they can attack each other during the first move of one of the bishops; "No" otherwise.

Input

The first line consists of an integer t (1 <= t <= 1000), the number of test cases. For each test case, you will be given the description of the board with 8 strings (8 characters in each string). 'B' denotes a cell with a bishop and '.' denotes an empty cell. There is an empty line after every test case.

Output

For each test case print "Yes" or "No" (case sensitive).

Example

Input:
2
.......B
........
........
....B...
........
........
........
........

........
........
........
.B...B..
........
........
........
........

Output:
Yes
No

Added by:cegprakash
Date:2013-02-24
Time limit:2s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: BF

hide comments
2018-01-12 15:11:50
poor format of input very poor :(
2016-06-18 13:04:48
ac in one go :)
2015-04-22 16:35:54 kapti
test cases anyone ???
2015-04-03 23:50:25 Archangel
very poor format of input :/
2014-12-11 17:33:05 Rahul Lingala
Should we check whether they will attack each other only for the first step or forever?

Result : Understood after looking at the test cases.

Last edit: 2014-12-11 17:34:14
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.