Rahul is going to participate in a treasure hunt contest. He already has the map of the treasure hunt area. You are to find if a path exists from his starting position to the treasure. In each move Rahul can move up, down, left or right from the current cell. The map is given in the form of a NxN 2D grid. Each cell in the grid is either blocked or available for moving. Rahul’s position in the map is represented by ‘R’, available cells are represented by ‘*’ and blocked cells are represented by ‘#’. The treasure is located in the cell containing ‘T’. It is guaranteed that the given map contains exactly one ‘R’ and one ‘T’. Print “YES” if Rahul can reach the treasure OR “NO” if he can not reach the treasure.
NOTE: Rahul can not move on a cell containing '#'. In other words he can not move on a blocked cell.
INPUT:
The first line will consist of an integer T denoting the number of test cases. Each test case will consist of an integer N denoting the dimension of the map. The next N lines will each contain 1 string denoting the map. (without spaces)
OUTPUT:
“YES” if Rahul can reach the treasure. “NO” if he can not reach the treasure.
CONSTRAINTS:
1 <= T <= 10
2 <= N <= 200