import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; /** * * @author muran4 */ public class Forest { public static char[][] pole; public static int m,n; /** * @param args the command line arguments */ public static void main(String[] args) throws IOException { BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); String line; String[] arr; long[] serie; int num; while((line = input.readLine())!=null){ arr = line.split(" "); m = Integer.parseInt(arr[0]); n = Integer.parseInt(arr[1]); int x,y,s; pole = new char[m][m]; for (int i = 0; i < m; i++) { for (int j = 0; j < m; j++) { pole[i][j] = '.'; } } for (int i = 0; i < n; i++) { line = input.readLine(); arr = line.split(" "); s = Integer.parseInt(arr[0]); x = Integer.parseInt(arr[1]); y = Integer.parseInt(arr[2]); if(s == 0){ drawIfPossible("_o_", x-1,y); }else{ drawIfPossible("_|_", x-1,y); for (int j = 0; j < s; j++) { y++; drawIfPossible("/|\\", x-1,y); } drawIfPossible("^", x,y+1); } } vypis(); System.out.println(""); } } private static void drawIfPossible(String template, int x, int y) { // System.out.println(template+" "+x+" "+y); // vypis(); for (int i = 0; i < template.length(); i++) { if(isIn(x+i,y)){ pole[x+i][y] =template.charAt(i); } } } private static boolean isIn(int x, int y) { if(x < 0)return false; if(y<0)return false; if(x>=m)return false; if(y>=m)return false; return true; } private static void vypis() { for (int i = 0; i < m+2; i++) { System.out.print("*"); } System.out.println(""); for (int i = 0; i < m; i++) { System.out.print("*"); for (int j = 0; j < m; j++) { // if(pole[i][j] == ' '){ // System.out.print(); // } System.out.print(pole[j][m-i-1]); } System.out.println("*"); } for (int i = 0; i < m+2; i++) { System.out.print("*"); } System.out.println(""); } }