#include<cstdio>
using namespace std;

#define rep(i, n) for(i = 0;i < n;++i)

char f[5][8];
signed main(void){
  int i, j, n;
  for(int t = 0;;t++){
    if(scanf("%d", &n) == -1)break;
    if(t)puts("");
    rep(i, 5){
      rep(j, 8)f[i][j] = '*';
      f[i][2] = '=';
      f[i][1 - (n % 10) / 5] = ' ';
      f[i][3 + (n % 5)] = ' ';
      n /= 10;
    }

    rep(j, 8){
      rep(i, 5)printf("%c", f[4 - i][j]);
      puts("");
    }
  }
  return 0;
}