#include using namespace std; const int maxSize = 101; char forest[maxSize][maxSize]; void reset() { memset( forest, '.', maxSize * maxSize ); } int main() { int m, n; ios::sync_with_stdio(false); while ( cin >> m >> n ) { reset(); for ( int i = 0;i> s >> x >> y; if ( x < 0 - 2 || x > m +2 ) continue; if ( y > m || y + s + 2 < 0 ) continue; if ( s == 0 ) { if ( x - 1 >= 0 && x -1 < m ) forest[x-1][y] = '_'; if ( x >= 0 && x < m ) forest[x][y] = 'o'; if ( x + 1 >= 0 && x +1 < m ) forest[x+1][y] = '_'; } else { int min = y >= 0 ? y : 0; for ( int j = min; j <= y +s && j < m; ++j ) { forest[x][j] = '|'; } if ( x - 1 >= 0 && x -1 < m ) forest[x-1][y] = '_'; if ( x + 1 >= 0 && x +1 < m ) forest[x+1][y] = '_'; if ( y+s+1 < m && x > 0 && x < m ) forest[x][y+s+1] = '^'; min = y >= 0 ? y+1 : 0; for ( int j = min; j <= y +s && j < m; ++j ) { forest[x-1][j] = '/'; } for ( int j = min; j <= y +s && j < m; ++j ) { forest[x+1][j] = '\\'; } } } for ( int i = 0; i < m+2; ++i ) cout<<'*'; cout << "\n"; for ( int i = m-1; i>=0; --i ) { cout << "*"; for ( int j = 0; j