#include<iostream> #include<cstdio> #include<cstring> using namespace std; int main(){ int s,len,p,i,j,k; char n[10],d[25][100]; while(scanf("%d%s",&s,n)!=EOF,s){ len = strlen(n); for(i=0;i<len;i++){//第i+1个数 p = (s+2)*i; if(n[i]==‘0‘){ for(j=0;j<2*s+3;j++){//行数 if(j==0||j==2*s+2){ d[j][p] = ‘ ‘; for(k=p+1;k<p+1+s;k++) d[j][k] = ‘-‘; d[j][k] = ‘ ‘; } else if(j==s+1) for(k=p;k<p+s+2;k++) d[j][k] = ‘ ‘; else{ d[j][p] = ‘|‘; for(k=p+1;k<p+1+s;k++) d[j][k] = ‘ ‘; d[j][k] = ‘|‘; } } } else if(n[i]==‘1‘){ for(j=0;j<2*s+3;j++){ if(j==0||j==2*s+2||j==s+1) for(k=p;k<p+s+2;k++) d[j][k] = ‘ ‘; else{ for(k=p;k<p+1+s;k++) d[j][k] = ‘ ‘; d[j][k] = ‘|‘; } } } else if(n[i]==‘2‘){ for(j=0;j<2*s+3;j++){ if(j==0||j==s+1||j==2*s+2){ d[j][p] = ‘ ‘; for(k=p+1;k<p+1+s;k++) d[j][k] = ‘-‘; d[j][k] = ‘ ‘; } else if(j>0&&j<s+1){ for(k=p;k<p+s+1;k++) d[j][k] = ‘ ‘; d[j][k] = ‘|‘; } else{ d[j][p] = ‘|‘; for(k=p+1;k<p+s+2;k++) d[j][k] = ‘ ‘; } } } else if(n[i]==‘3‘){ for(j=0;j<2*s+3;j++){ if(j==0||j==s+1||j==s*2+2){ d[j][p] = ‘ ‘; for(k=p+1;k<p+1+s;k++) d[j][k] = ‘-‘; d[j][k] = ‘ ‘; } else{ for(k=p;k<p+s+1;k++) d[j][k] = ‘ ‘; d[j][k] = ‘|‘; } } } else if(n[i]==‘4‘){ for(j=0;j<2*s+3;j++){ if(j==0||j==s*2+2) for(k=p;k<p+s+2;k++) d[j][k] = ‘ ‘; else if(j>0&&j<s+1){ d[j][p] = ‘|‘; for(k=p+1;k<p+1+s;k++) d[j][k] = ‘ ‘; d[j][k] = ‘|‘; } else if(j==s+1){ d[j][p] = ‘ ‘; for(k=p+1;k<p+1+s;k++) d[j][k] = ‘-‘; d[j][k] = ‘ ‘; } else{ for(k=p;k<p+s+1;k++) d[j][k] = ‘ ‘; d[j][k] = ‘|‘; } } } else if(n[i]==‘5‘){ for(j=0;j<2*s+3;j++){ if(j==0||j==s+1||j==s*2+2){ d[j][p] = ‘ ‘; for(k=p+1;k<p+1+s;k++) d[j][k] = ‘-‘; d[j][k] = ‘ ‘; } else if(j>0&&j<s+1){ d[j][p] = ‘|‘; for(k=p+1;k<p+s+2;k++) d[j][k] = ‘ ‘; } else{ for(k=p;k<p+s+1;k++) d[j][k] = ‘ ‘; d[j][k] = ‘|‘; } } } else if(n[i]==‘6‘){ for(j=0;j<2*s+3;j++){ if(j==0||j==s+1||j==s*2+2){ d[j][p] = ‘ ‘; for(k=p+1;k<p+1+s;k++) d[j][k] = ‘-‘; d[j][k] = ‘ ‘; } else if(j>0&&j<s+1){ d[j][p] = ‘|‘; for(k=p+1;k<p+s+2;k++) d[j][k] = ‘ ‘; } else{ d[j][p] = ‘|‘; for(k=p+1;k<p+1+s;k++) d[j][k] = ‘ ‘; d[j][k] = ‘|‘; } } } else if(n[i]==‘7‘){ for(j=0;j<2*s+3;j++){ if(j==0){ d[j][p] = ‘ ‘; for(k=p+1;k<p+1+s;k++) d[j][k] = ‘-‘; d[j][k] = ‘ ‘; } else if(j==s+1||j==2*s+2) for(k=p;k<p+s+2;k++) d[j][k] = ‘ ‘; else{ for(k=p;k<p+s+1;k++) d[j][k] = ‘ ‘; d[j][k] = ‘|‘; } } } else if(n[i]==‘8‘){ for(j=0;j<2*s+3;j++){ if(j==0||j==s+1||j==2*s+2){ d[j][p] = ‘ ‘; for(k=p+1;k<p+1+s;k++) d[j][k] = ‘-‘; d[j][k] = ‘ ‘; } else{ d[j][p] = ‘|‘; for(k=p+1;k<p+1+s;k++) d[j][k] = ‘ ‘; d[j][k] = ‘|‘; } } } else if(n[i]==‘9‘){ for(j=0;j<2*s+3;j++){ if(j==0||j==s+1||j==2*s+2){ d[j][p] = ‘ ‘; for(k=p+1;k<p+1+s;k++) d[j][k] = ‘-‘; d[j][k] = ‘ ‘; } else if(j>0&&j<s+1){ d[j][p] = ‘|‘; for(k=p+1;k<p+1+s;k++) d[j][k] = ‘ ‘; d[j][k] = ‘|‘; } else{ for(k=p;k<p+s+1;k++) d[j][k] = ‘ ‘; d[j][k] = ‘|‘; } } } } for(j=0;j<2*s+3;j++){ for(i=0;i<len;i++){ for(k=i*(s+2);k<(i+1)*(s+2);k++){ printf("%c",d[j][k]); } if(i!=len-1) printf(" "); } printf("\n"); } printf("\n"); } return 0; }