#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
int n;
//存放素数因子
int arr[1000000];
//数字矩阵
char number[10][5][3] =
{
{' ','-',' ','|',' ','|',' ',' ',' ','|',' ','|',' ','-',' '},
{' ',' ',' ',' ',' ','|',' ',' ',' ',' ',' ','|',' ',' ',' '},
{' ','-',' ',' ',' ','|',' ','-',' ','|',' ',' ',' ','-',' '},
{' ','-',' ',' ',' ','|',' ','-',' ',' ',' ','|',' ','-',' '},
{' ',' ',' ','|',' ','|',' ','-',' ',' ',' ','|',' ',' ',' '},
{' ','-',' ','|',' ',' ',' ','-',' ',' ',' ','|',' ','-',' '},
{' ','-',' ','|',' ',' ',' ','-',' ','|',' ','|',' ','-',' '},
{' ','-',' ',' ',' ','|',' ',' ',' ',' ',' ','|',' ',' ',' '},
{' ','-',' ','|',' ','|',' ','-',' ','|',' ','|',' ','-',' '},
{' ','-',' ','|',' ','|',' ','-',' ',' ',' ','|',' ','-',' '}
};
//乘号
char mul[5] = {' ',' ','*',' ',' '};
int main( )
{
while(cin>>n)
{
int counter = 0;
for(int i=2; i<n; i++)
{
while(n!=i)
{
if(n%i==0)
{
arr[counter++] = i;
n=n/i;
}
else break;
}
}
arr[counter++] = n;
//中间字符串结果
string result = "";
for(int i = 0; i < counter; i++)
{
string str;
char t[256];
sprintf(t,"%d",arr[i]);
str = t;
if(i != counter - 1)
{
result += str + '*';
}
else
{
result += str;
}
}
//转化为矩阵形式
for(int o = 0; o < 5; o++)
{
for(int j = 0; j < result.length(); j++)
{
if(result[j] != '*'){
for(int q = 0;q < 3;q++){
cout << number[result[j] - '0'][o][q];
}
}else{
cout << mul[o];
}
}
cout << endl;
}
}
return 0;
}