There is a single integer
(
) in the first line of the standard input, denoting the number of data sets.
The following lines describe these data sets.
The first line of a single description holds a single integer
(
), denoting the number of walls in the main exhibition room.
Then the following
lines specify the room's shape.
Each of those lines contains a pair of integers
and
(
for
), separated by a single space, denoting the coordinates of the room's corner or, in other words, the vertex of corresponding polygon. The vertices are given clockwise.
The next
lines specify the tapestries' requirements.
Each of those lines contains a single letter, S or C, denoting that the wall has to be illuminated or shaded, respectively.
The letter in the
-th of these lines (for
) regards the wall between the
-th and the
-th vertex.
The letter in the last of these lines regards the wall between the last and the first vertex.
The polygon depicting the room's shape has no self-crossings, i.e., with the exception of successive sides, which share a common vertex, no two sides of the polygon share a common point. Furthermore, no three vertices …