Go: package main

import (
	"bufio"
	"fmt"
		"os"
	"strconv"
	"strings"
	)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	table := [10]string{
		"* = ****",
		"* =* ***",
		"* =** **",
		"* =*** *",
		"* =**** ",
		" *= ****",
		" *=* ***",
		" *=** **",
		" *=*** *",
		" *=**** ",
	}
	input := make([]string, 0)
	for scanner.Scan() {
		input = append(input, scanner.Text())
	}
	n := len(input)
	cnt := 0
	for cnt < n {
		tmp := strings.Split(fmt.Sprintf("%05s", input[cnt]), "")
		ans := make([]string, 0)
		for _, v := range tmp {
			iv, _ := strconv.Atoi(v)
			ans = append(ans, table[iv])
		}
		for i := 0; i < 8; i++ {
			for j := 0; j < 5; j++ {
				fmt.Print(string(ans[j][i]))
			}
			fmt.Println()
		}
		if cnt != n-1 {
			fmt.Println()
		}
		cnt++
	}
}

C++: cnt = 0
while True:
    d = [[' ' for i in range(8)]  for j in range(5)]
    try:
        if (cnt != 0):
            cnt += 1
            print
        n = raw_input()
        while len(n) < 5:
            n = '0' + n    
        for i in range(len(n)):
            if (int(n[i]) <= 4):
                d[i][0] = '*'
            if (int(n[i]) >= 5):
                d[i][1] = '*'
            d[i][2] = '='
            if (int(n[i]) != 0 and int(n[i]) != 5):
                d[i][3] = '*'
            if (int(n[i]) != 1 and int(n[i]) != 6):
                d[i][4] = '*'
            if (int(n[i]) != 2 and int(n[i]) != 7):
                d[i][5] = '*'
            if (int(n[i]) != 3 and int(n[i]) != 8):
                d[i][6] = '*'
            if (int(n[i]) != 4 and int(n[i]) != 9):
                d[i][7] = '*'

        for i in range(8):
            s = ""
            for j in range(5):
                s += d[j][i]
            print s
    except:
        break

C++: #include <iostream>
#include <cstring>
#include <string>
using namespace std;
char c[5][9];
string d[10] = {
  "* = ****", "* =* ***", "* =** **", "* =*** *", "* =**** ",
  " *= ****", " *=* ***", " *=** **", " *=*** *", " *=**** ",
};
int main()
{
  int n,i,j;
  bool f = false;
  while(cin >> n){
    if(f) cout << endl;
    for(i=0; i<5; i++){
      memcpy(c[i], d[n%10].c_str(), 8);
      n /= 10;
    }
    for(i=0; i<8; i++){
      for(j=4; j>=0; j--){
	cout << c[j][i];
      }
      cout << endl;
    }
    f = true;
  }
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
int main()
{
	char s[6], r[5][8], d;
	int n = -1, i, j, c;
	while (1)
	{
		if (cin.eof()) break;
		cin >> n;
		sprintf(s, "%05d", n);
		for (i = 0; i < 5; i++)
		{
			d = (char)s[i];
			c = atoi(&d);
			if (c < 5)
			{
				r[i][0] = '*';
				r[i][1] = ' ';
			}
			else
			{
				r[i][0] = ' ';
				r[i][1] = '*';
			}
			r[i][2] = '=';
			for (j = 3; j < 8; j++)
			{
				if (c != j-3 && c != j+2)
					r[i][j] = '*';
				else
					r[i][j] = ' ';
			}
		}
		for (i = 0; i < 8; i++)
		{
			for (j = 0; j < 5; j++)
			{
				cout << r[j][i];
			}
			cout << endl;
		}
		cout << endl;
	}
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
int main()
{
	char s[6], r[5][8], d;
	int n, i, j, c;
	while (1)
	{
		cin >> n;
		if (cin.eof()) break;
		sprintf(s, "%05d", n);
		for (i = 0; i < 5; i++)
		{
			d = (char)s[i];
			c = atoi(&d);
			if (c < 5)
			{
				r[i][0] = '*';
				r[i][1] = ' ';
			}
			else
			{
				r[i][0] = ' ';
				r[i][1] = '*';
			}
			r[i][2] = '=';
			for (j = 3; j < 8; j++)
			{
				if (c != j-3 && c != j+2)
					r[i][j] = '*';
				else
					r[i][j] = ' ';
			}
		}
		for (i = 0; i < 8; i++)
		{
			for (j = 0; j < 5; j++)
			{
				cout << r[j][i];
			}
			cout << endl;
		}
		cout << endl;
	}
}

C++: #include<iostream>
#include<string>
using namespace std;int main(){int i,j=0,n[5];string s;char x[5],l[2]={' ','*'};while(cin>>i){if(j)cout<<endl;sprintf(x,"%05d",i);for(j=5;j-->0;)n[j]=x[j]-'0';s="";while(j++<1){for(i=0;i<5;i++)s+=l[j+(n[i]<5)&1];s+="\n";}for(j=5;j-->0;)s+="=";s+="\n";while(j++<4){for(i=0;i<5;i++)s+=l[n[i]%5!=j];s+="\n";}cout<<s;}return 0;}

C++: #include<stdio.h>

int main(void){
	int n,i,j;
	int joudan[5],gedan[5];
	int data[7][5];

	while(scanf("%d",&n)!=EOF){

		for(i=0;i<7;i++)
			for(j=0;j<5;j++)
				data[i][j]=1;

		for(i=4;i>=0;i--){
			joudan[i]=(n%10)/5;
			gedan[i]=(n%10)%5;
			n/=10;
		}
		  for(i=0;i<5;i++){//上段の判定
			  if(joudan[i]==1)
				  data[0][i]=0;
			  else 
				  data[1][i]=0;
		  }

		 for(i=0;i<5;i++){
			  if(gedan[i]==0)
				 data[2][i]=0;
			  else if(gedan[i]==1)
				  data[3][i]=0;
			  else if(gedan[i]==2)
				  data[4][i]=0;
			  else if(gedan[i]==3)
				  data[5][i]=0;
			  else if(gedan[i]==4)
				  data[6][i]=0;
		  }
		for(i=0;i<2;i++)
			for(j=0;j<5;j++){
				if(data[i][j]==1)
					printf("*");
				else
					printf(" ");
				if(j==4) printf("\n");
			}

		for(i=0;i<5;i++){
			printf("=");
			if(i==4) printf("\n");
		}

		for(i=2;i<7;i++)
			for(j=0;j<5;j++){
				if(data[i][j]==1)
					printf("*");
				else
					printf(" ");
				if(j==4) printf("\n");
			}
		//	printf("\n");
	}
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;

int main(){

	int n, len, cnt, set;
	char sb[7][5];
	string str;
	
	set = 0;	

	while(cin >> str){
		set++;
		if(set != 1) cout << endl;
		cnt = 0;
		len = str.length();
		for(int i=0; i<5; i++){
			if(len+i >= 5){
				n = str[cnt] - '0';
				cnt++;
			}
			else n = 0;
			if(n >= 5){
				sb[0][i] = ' ';
				sb[1][i] = '*';
			}
			else {
				sb[0][i] = '*';
				sb[1][i] = ' ';
			}
			for(int j=2; j<7; j++){
				sb[j][i] = '*';
			}
			sb[n%5+2][i] = ' ';
		}
		
		for(int i=0; i<7; i++){
			for(int j=0; j<5; j++){
				cout << sb[i][j];
			}
			cout << endl;
			if(i == 1) cout << "=====" << endl;
		}
	}

	return 0;

}

C++: #include <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

const string abcus[10] = {"* = ****","* =* ***","* =** **","* =*** *","* =**** "," *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** "};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  bool f = false;
  while(cin >> s){
    if(f) cout << endl;
    while(s.size()<5){
      s = "0" + s;
    }
    rep(i,8){
      rep(j,5){
        cout << abcus[s[j]-'0'][i] ;
      }
      cout << endl;
    }
    f = true;
  }
  return 0;
}