import java.io.*; class dd { public static void main(String[] args) { BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); String line; int i; try { while( (line = stdin.readLine()) != null) { if(line.compareTo("end") == 0) { System.out.println("end"); break; } line = line.trim(); printClock(line); } } catch (IOException ex){} } private static void repeatString(String s, int count) { for (int i = 0; i < count; i++) { System.out.print(s); } } private static void printClock(String clock) { char[] chars = clock.toCharArray(); for(int i = 0; i < 7; i++ ) { for(int j = 0; j < 5; j++ ) { char c = chars[j]; switch (c){ case '1': repeatString(" ", 4); if (i == 0 || i == 3 || i == 6) { System.out.print("+"); } else { System.out.print("|"); } break; case '2': if (i == 0 || i == 3 || i == 6) { System.out.print("+"); repeatString("-", 3); System.out.print("+"); } else if (i < 3) { repeatString(" ", 4); System.out.print("|"); } else if (i > 3) { System.out.print("|"); repeatString(" ", 4); } break; case '3': if (i == 0 || i == 3 || i == 6 ) { System.out.print("+"); repeatString("-", 3); System.out.print("+"); } else { repeatString(" ", 4); System.out.print("|"); } break; case '4': if (i == 0){ System.out.print("+"); repeatString(" ", 3); System.out.print("+"); } else if (i == 1 || i == 2) { System.out.print("|"); repeatString(" ", 3); System.out.print("|"); } else if (i == 3) { System.out.print("+"); repeatString("-", 3); System.out.print("+"); } else if (i > 3) { repeatString(" ", 4); if (i == 6) { System.out.print("+"); } else { System.out.print("|"); } } break; case '5': if (i == 0 || i == 3 || i == 6) { System.out.print("+"); repeatString("-", 3); System.out.print("+"); } else if (i < 3) { System.out.print("|"); repeatString(" ", 4); } else if (i > 3) { repeatString(" ", 4); System.out.print("|"); } break; case '6': if (i == 0 || i == 3 || i == 6) { System.out.print("+"); repeatString("-", 3); System.out.print("+"); } else if (i < 3) { System.out.print("|"); repeatString(" ", 4); } else if (i > 3) { System.out.print("|"); repeatString(" ", 3); System.out.print("|"); } break; case '7': if (i == 0){ System.out.print("+"); repeatString("-", 3); System.out.print("+"); } else if (i == 1 || i == 2 || i == 4 || i == 5 ) { repeatString(" ", 4); System.out.print("|"); } else if (i == 3 || i == 6) { repeatString(" ", 4); System.out.print("+"); } break; case '8': if (i == 0 || i == 3 || i == 6) { System.out.print("+"); repeatString("-", 3); System.out.print("+"); } else { System.out.print("|"); repeatString(" ", 3); System.out.print("|"); } break; case '9': if (i == 0 || i == 3 || i == 6) { System.out.print("+"); repeatString("-", 3); System.out.print("+"); } else if (i < 3) { System.out.print("|"); repeatString(" ", 3); System.out.print("|"); } else if (i > 3) { repeatString(" ", 4); System.out.print("|"); } break; case '0': if (i == 0 || i == 6) { System.out.print("+"); repeatString("-", 3); System.out.print("+"); } else if(i == 3) { System.out.print("+"); repeatString(" ", 3); System.out.print("+"); }else { System.out.print("|"); repeatString(" ", 3); System.out.print("|"); } break; case ':': if(i == 2 || i == 4) { System.out.print("o"); }else { System.out.print(" "); } break; } if (j < 4) { System.out.print(" "); } } System.out.println(); } System.out.println(); System.out.println(); } }