10201 - Cross Bomb!!   

Description

Consider an N-by-N two-dimensional map which is filled with symbol '+'.
Now, we detonate(引爆) several bombs on the map.
The shape of explosion is cross that is centered at the location (ROW,COLUMN) and with a radius of 2.
Fill the part of cross with symbol S.

For example, the following is a 10-by-10 map, where the bomb is centered at (4, 4).
That is, we have N=10, ROW=4, COLUMN=4 and S='-'.


Note that, in some cases, the bomb might be close to the border of the map,
and therefore only a part of the cross can be shown on the map.

For example,

And if there have several bombs,
the bomb will cover the current symbol that may be the initial symbol or the previous bombs' on the map.

Input

The first line is an integer N (1<=N<=30) denoting the size of the map.

The second line is an integer M ( 1<=M<=10 ) denoting the amount of bombs.

Start from third line, you need to read M lines.
And each line contains three elements, in the order of ROW, COLUMN and S: 

  • Two integers ROW and COLUMN (1<=ROW,COLUMN<=N) denoting the location of the bomb.
  • A character S denoting the symbol that is drawn on the map.

Output

The N-by-N map, displayed in N lines. Each line is ended with a newline character '\n'.

Sample Input  Download

Sample Output  Download

Tags




Discuss