#include using namespace std; int main(void) { while(true) { int rozmer; cin >> rozmer; if(cin.eof()) break; char ** pole = new char*[rozmer]; for(int i = 0; i < rozmer; i++) { pole[i] = new char[rozmer]; for(int j = 0; j < rozmer; j++) { pole[i][j] = '.'; } } int pocet; cin >> pocet; for(int i = 0; i < pocet; i++) { int typ, x, y; cin >> typ >> x >> y; switch(typ) { case 0: if(y >= rozmer || y < 0) break; if(x - 1 < rozmer && x - 1 >= 0) pole[y][x - 1] = '_'; if(x < rozmer && x >= 0) pole[y][x] = 'o'; if(x + 1 < rozmer && x + 1 >= 0) pole[y][x + 1] = '_'; break; default: if(y >= rozmer) break; if(y + typ + 1 < 0) break; if(x - 1 >= rozmer || x + 1 < 0) break; if(y >= 0 && y < rozmer) { if(x - 1 < rozmer && x - 1 >= 0) pole[y][x - 1] = '_'; if(x < rozmer && x >= 0) pole[y][x] = '|'; if(x + 1 < rozmer && x + 1 >= 0) pole[y][x + 1] = '_'; } if(x < rozmer && x >= 0 && y + typ + 1 < rozmer) pole[y + typ + 1][x] = '^'; for(int j = 1; j <= typ; j++) { if(y + j >= 0 && y + j < rozmer) { if(x - 1 < rozmer && x - 1 >= 0) pole[y + j][x - 1] = '/'; if(x < rozmer && x >= 0) pole[y + j][x] = '|'; if(x + 1 < rozmer && x + 1 >= 0) pole[y + j][x + 1] = '\\'; } } break; } } //vypis for(int i = 0; i < rozmer + 2; i++) cout << "*"; cout << endl; for(int i = rozmer - 1; i >= 0; i--) { cout << "*"; for(int j = 0; j < rozmer; j++) { cout << pole[i][j]; } cout << "*" << endl; delete [] pole[i]; } for(int i = 0; i < rozmer + 2; i++) cout << "*"; cout << endl; delete [] pole; } return 0; }