Write a program that draws a border around a closed path on a bitmap, as shown in the figure below.

The path is closed and runs along the grid lines, that is, between the squares of the grid. The path runs counter-clockwise, so if you think of following the path as moving "forward", the border pixels are always to the "right" of the path. The bitmap always covers a 32 by 32 area of squares and has its lower-left corner at (0, 0). You may assume that the path never touches the bounding rectangle of the bitmap and never touches or crosses itself.
A square (bit) is set when it lies outside the region enclosed by the path and at least one of its edges lies on the path. A square is not set if only one of its corners touches the path. Looking at the convex corners in the figure should make this clear.
The first line of the input contains the number of test cases.
Each test case consists of two lines:
x and y, the starting point of the path.W (west), E (east), N (north), and S (south). The character . marks the end of the path (no move) and appears immediately at the end of the line.For each test case, first print a line Bitmap #k, where k is the case number (starting from 1).
Then print the bitmap one line per row, from top to bottom. In each row, print one character per column from left to right: an uppercase X for a set bit and a period . for an unset bit. The bitmap has 32 rows and 32 columns.
Print a blank line between two consecutive bitmaps.