/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ import java.io.*; import java.io.BufferedReader; import java.io.InputStreamReader; /** * * @author cteam056 */ // předělat na Main class Main { public static BufferedReader in; private static String line; private static int[] otherLine; private static String [] strotherLine; private static int N; private static long F; private static char [][] painting; /** * @param args the command line arguments * @throws java.io.IOException */ public static void main(String[] args) throws IOException { // TODO code application logic here in = new BufferedReader(new InputStreamReader(System.in)); String[] firstLine; while((line = in.readLine()) != null && !line.isEmpty()) { firstLine = line.split(" "); N = Integer.parseInt(firstLine[0]); // sirka platna vyska platna F = Integer.parseInt(firstLine[1]); // pocet dalsich radku painting = new char[N][N]; for(int i = 0; i < N; i++) { for(int j = 0; j < N; j++) { painting[i][j] = '.'; } } otherLine = new int[3]; for(long i = 0; i < F; i++) { line = in.readLine(); strotherLine = line.split(" "); for(int j = 0; j < 3; j++) { otherLine[j] = Integer.parseInt(strotherLine[j]); } if (otherLine[0] == 0) { printTreeBottom(otherLine[1], otherLine[2], 'o'); } else { for(int k = 0; k <= otherLine[0]; k++) { printTreeLevel(otherLine[1], otherLine[2] + k); } printTreeTop(otherLine[1], otherLine[2] + otherLine[0] + 1, '^'); printTreeBottom(otherLine[1], otherLine[2], '|'); } } //System.out.println(seradMonstra()); printTree(); } } private static void printTreeLevel(int x, int y) { if (y < 0 || y >= N) return; if (!(x < 0 || x >= N)) painting[y][x] = '|'; if(x - 1 >= 0) { painting[y][x-1] = '/'; } if(x + 1 < N) { painting[y][x+1] = '\\'; } } private static void printTreeTop(int x, int y, char ch) { if (y < 0 || y >= N) return; if (!(x < 0 || x >= N)) painting[y][x] = ch; } private static void printTreeBottom(int x, int y, char ch) { if (y < 0 || y >= N) return; if (!(x < 0 || x >= N)) painting[y][x] = ch; if(x - 1 >= 0) { painting[y][x-1] = '_'; } if(x + 1 < N) { painting[y][x+1] = '_'; } } private static void printTree() { for(int i = 0; i < N + 2; i++) { System.out.print("*"); } System.out.println(); for(int i = N - 1; i >= 0; i--) { System.out.print("*"); for(int j = 0; j < N; j++) { System.out.print(painting[i][j]); } System.out.println("*"); } for(int i = 0; i < N + 2; i++) { System.out.print("*"); } System.out.println(); System.out.println(); } /*private static int seradMonstra() { int retVal = 0; int tmp; for(int i = 0; i < N; i++) { if (monsters[i] != i + 1) { tmp = monsters[i]; monsters[i] = monsters[tmp - 1]; monsters[tmp - 1] = tmp; retVal++; i--; } } return retVal; }*/ }