Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.

HS11MCTP - More Caterpillars

As we mentioned previously, there are two types of caterpillars.

Your new task is to print several caterpillars which are relaxing, lying on a square.

Input

First two integers: c, 1<=c<=100, denoting the number of caterpillars and n, 10<=n<=100 the size of the square. Each of the next lines consists of one letter (V, for vertical caterpillars or H for horizontal ones, an integer 3<=n<=20 - the caterpillar size in segments and two integers: x, y denoting the coordinates of the upper left corner of the given caterpillar.

Output

The nxn square and the caterpillars according to the description. Please consult the examples below.

Examples

Example 1

Input:
2 12
V5 1 1
H3 7 10

Output:
###.........
..#.........
###.........
#...........
###.........
..#.........
###.........
#...........
###.........
..#...#.###.
......#.#.#.
......###.##

Example 2

Input:
4 14
H3 3 1
H3 4 4
V4 2 5
V3 8 7 

Output:
..#.###.......
..#.#.#.......
..###.##......
...#.###......
.###.#.#......
...###.##.....
.###...###....
.#.......#....
.###...###....
...#...#......
.###...###....
.#.......#....
..............
..............

Scoring

By solving this problem you score 10 points.


Added by:kuszi
Date:2011-10-15
Time limit:0.200s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:ADA95 ASM32 BASH BF C CSHARP C++ 4.3.2 CPP C99 CLPS CLOJURE LISP sbcl LISP clisp D ERL FSHARP FORTRAN GO HASK ICON ICK JAVA JS-RHINO LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PERL6 PHP PIKE PRLG-swi PYTHON PYTHON3 RUBY SCALA SCM guile SCM qobi ST TCL WHITESPACE
Resource:High School Programming League

© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.