An exhibition of tapestries is opening in a museum of fine arts. Viewed from above, the main exhibition room is a polygon, not necessarily convex. A tapestry hangs on each wall of the room and covers the entire wall.
A lamp has been installed to illuminate the exhibition. It glows uniformly in all directions. Some tapestries have to be flooded with light, while others must not be exposed to strong light.
Your task is to determine whether there is a spot for the lamp that satisfies all of the following:
The first line contains a single integer t (1≤t≤20), the number of data sets. The data sets follow.
Each data set begins with a line containing a single integer n (3≤n≤1000), the number of walls of the exhibition room. The next n lines describe the room: the i-th of them contains two integers xi and yi (−30000≤xi,yi≤30000), the coordinates of the i-th vertex of the polygon. The vertices are given in clockwise order.
The following n lines describe the tapestry requirements, one letter per line: S if the wall must be illuminated, or C if it must be shaded. For 1≤i≤n−1, the i-th of these letters refers to the wall between vertex i and vertex i+1, and the last letter refers to the wall between vertex n and vertex 1.
The polygon has no self-intersections: apart from consecutive sides, which share a common vertex, no two sides share a common point. Moreover, no three vertices are collinear.
For each data set, print a single line containing one word: TAK (Polish for "yes") if the lamp can be placed so that all requirements are met, or NIE (Polish for "no") otherwise.

