n=3 while 1:r=raw_input();n-=1;a=ord(r[0])%48;p=q=2-n/a-a/5;exec"b=%s;q+=1;print((' +|'+l/b*'- '+'+|')[q%%p>1::2]*b)[1:];n=3;"%r[2:]*p*a;l=len(r)-2