var soroban=[
"* = ****".split(""),
"* =* ***".split(""),
"* =** **".split(""),
"* =*** *".split(""),
"* =**** ".split(""),
" *= ****".split(""),
" *=* ***".split(""),
" *=** **".split(""),
" *=*** *".split(""),
" *=**** ".split("")
];
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.replace(/\n$/,"")).split("\n").map(Number);
Arr.forEach(function(v,i){
   if(i!==0)console.log("");
   var str=("00000"+v).slice(-5);
   var arr=["","","","","","","",""];
   for(var i=0;i<5;i++){
      var s=soroban[(str[i]-0)];
      s.forEach(function(v,index){arr[index]+=v;});
   }
   console.log(arr.join("\n"));
});