#include using namespace std; int main() { long m, n; while (cin >> m >> n) { char ** pic = new char*[m + 2]; for (short i = 0; i < m + 2; i++) { pic[i] = new char[m + 2]; for (short j = 0; j < m + 2; j++) { if (i == 0 || i == m + 1) { pic[i][j] = '*'; } else { if (j == 0 || j == m + 1) { pic[i][j] = '*'; } else { pic[i][j] = '.'; } } } } for (long i = 0; i < n; i++) { short s; long x, y; cin >> s >> x >> y; if (x >= -1 && x <= m) { if (y < m && y > -s - 2) { for (int tl = y + 1; tl < y + s + 3; tl++) { if (tl < 1 || tl > m) { continue; } for (int tc = x; tc < x + 3; tc++) { if (tc < 1 || tc > m) { continue; } if (tl == y + 1) { if (tc == x + 1) { if (s == 0) { pic[tl][tc] = 'o'; } else { pic[tl][tc] = '|'; } } else { pic[tl][tc] = '_'; } } else if (tl == y + s + 2) { if (tc == x + 1) { pic[tl][tc] = '^'; } } else { if (tc == x + 1) { pic[tl][tc] = '|'; } else if (tc == x) { pic[tl][tc] = '/'; } else { pic[tl][tc] = '\\'; } } } if (s == 0) { break; } } } } } for (int i = m + 1; i >= 0; i--) { for (int j = 0; j < m + 2; j++) { cout << pic[i][j]; } cout << endl; } cout << endl; } return 0; }