#include #include #include char pic[104][130]; int main() { using namespace std; ios::sync_with_stdio(false); size_t n = 0; size_t m = 0; while (cin >> m) { cin >> n; for (size_t i = 2; i < m + 2; ++i) { for (size_t j = 15; j < m + 15; ++j) { pic[j][i] = '.'; } } for (size_t i = 0; i < n; ++i) { int s,x,y; cin >> s >> x >> y; if (y < -11 || y > (int)m + 11) { continue; } if (x <= -2 || x >(int) m + 1) { continue; } x += 2; y += 15; if (s == 0) { pic[y][x -1] = '_'; pic[y][x+1] = '_'; pic[y][x] = 'o'; continue; } pic[y][x-1] = '_'; pic[y][x+1] = '_'; pic[y][x] = '|'; for (int j = 1; j <= s; ++j) { pic[y + j][x -1] = '/'; pic[y + j][x] = '|'; pic[y + j][x +1] = '\\'; } pic[y + s + 1][x] = '^'; } for (size_t i =0; i < m +2; ++i) { printf("*"); } printf("\n"); for (int i = m +14 ; i >= 15; --i) { printf("*"); pic[i][m + 2] = '\0'; printf("%s", pic[i] + 2); printf("*\n"); } for (size_t i =0; i < m + 2; ++i) { printf("*"); } printf("\n\n"); } return 0; }