#include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <stack>
#include <string>
//#include <unordered_map>
#include <map>

using namespace std;

#define debug(x) cout<<#x<<": "<<(x)<<endl;
#pragma warning(disable:4996)

bool print(int n,vector<int> nums) {

string a[10][5] = {
{
" - ",
"| |",
" ",
"| |",
" - "
},
{
" ",
" |",
" ",
" |",
" "
},
{
" - ",
" |",
" - ",
"| ",
" - ",
},
{
" - ",
" |",
" - ",
" |",
" - ",
},
{
" ",
"| |",
" - ",
" |",
" ",
},
{
" - ",
"| ",
" - ",
" |",
" - ",
},
{
" - ",
"| ",
" - ",
"| |",
" - ",
},
{
" - ",
" |",
" ",
" |",
" ",
},
{
" - ",
"| |",
" - ",
"| |",
" - ",
},
{
" - ",
"| |",
" - ",
" |",
" - ",
},

};

for (int r = 0; r < 5; ++r) { //一行一行打

if (r % 2 == 1) {
for (int m = 0; m < n; ++m) {
for (int ii = 0; ii < nums.size(); ++ii) {
int i = nums[ii];
cout << a[i][r][0];
for (int k = 0; k < n; ++k) {
cout << a[i][r][1];
}
cout << a[i][r][2];
cout << " ";
}
cout << endl;
}
}
else {

for (int ii = 0; ii < nums.size(); ++ii) {
int i = nums[ii];
cout << a[i][r][0];
for (int k = 0; k < n; ++k) {
cout << a[i][r][1];
}
cout << a[i][r][2];
cout << " ";
}
cout << endl;
}

}
return true;

}

int main() {


/*
*

s+2 2s+3

-- -- --
| | | | | |
| | | | | |
-- -- -- --
| | | | |
| | | | |
-- -- --

--- --- --- --- ---
| | | | | | | |
| | | | | | | |
| | | | | | | |
--- --- ---
| | | | | | | |
| | | | | | | |
| | | | | | | |
--- --- --- ---

--- --- --- --- ---
| | | | | | | |
| | | | | | | |
| | | | | | | |
--- --- ---
| | | | | | | |
| | | | | | | |
| | | | | | | |
--- --- --- ---

*/
//2s+3 s+2
//freopen("../in1.txt","r",stdin);
int n, m;
while (cin>>n>>m) {
if (n == 0) {
break;
}
vector<int>a;
a.insert(a.begin(),m % 10);
m /= 10;
while (m>0){
a.insert(a.begin(), m % 10);
m /= 10;
}
print(n,a);
cout << endl;
}

return 0;
}

POJ1102 LC-Display【两组数据之间有空行】_#pragma