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++
	}
}

Python: dic = {"0":"* = ****",
       "1":"* =* ***",
       "2":"* =** **",
       "3":"* =*** *",
       "4":"* =**** ",
       "5":" *= ****",
       "6":" *=* ***",
       "7":" *=** **",
       "8":" *=*** *",
       "9":" *=**** "}
def trans(lst):
  ylen = len(lst)
  xlen = len(lst[0])
  ret = [[None] * ylen for _ in range(xlen)]
  for y in range(ylen):
    for x in range(xlen):
      ret[x][y] = lst[y][x]
  return ret

def print_abac(num):
  num = num.zfill(5)
  lst = [dic[c] for c in num]
  lst = trans(lst)
  for line in lst:
    print("".join(line))

cnt = 0
while True:
  try:
    num = input()
    if cnt != 0:
      print()
    else:
      cnt += 1
    print_abac(num)
  
  except EOFError:
    break

Python: f=0
while 1:
    try:n=int(input())
    except:break
    if f:print()
    f=1
    a=[['*' for _ in range(5)]for _ in range(8)]
    for i in range(4,-1,-1):
        b=n%10
        a[not b//5][i]=' '
        a[b%5+3][i]=' '
        n//=10
    a[2]='='*5
    for i in a:
        print(''.join(i),end='')
        print()

Python: from sys import stdout


def upper(n):
    if n < 5:
        return list("* ")
    else:
        return list(" *")


def lower(n):
    m = n % 5
    a = ['*'] * m + [' ']
    a = a + ['*'] * (5 - len(a))
    return a


def abacus(n):
    return upper(n) + ['='] + lower(n)


while True:
    try:
        ns = map(int, ("0" + raw_input().strip())[-5:])
    except EOFError:
        break

    ab = []
    for n in ns:
        ab.append(abacus(n))

    for i in range(8):
        for j in range(5):
            stdout.write(ab[j][i])
        stdout.write("\n")

    print

Python: f=0
while 1:
    try:n=int(input())
    except:break
    if f:print()
    f=1
    a=[[0 for _ in range(5)]for _ in range(8)]
    for i in range(4,-1,-1):
        b=n%10
        a[not b//5][i]=1
        a[b%5+3][i]=1
        n//=10
    for i in range(8):
        for j in range(5):
            if i==2:print('=',end='')
            else:print(' ' if a[i][j] else '*',end='')
        print()

Python: f=0
while 1:
    try:n=int(input())
    except:break
    if f:print()
    f=1
    a=[[0 for _ in range(5)]for _ in range(8)]
    for i in range(4,-1,-1):
        b=n%10
        if b>=5:a[0][i]=1
        else: a[1][i]=1
        a[b%5+3][i]=1
        n//=10
    for i in range(8):
        for j in range(5):
            if i==2:print('=',end='')
            else:print(' ' if a[i][j] else '*',end='')
        print()

Python: L = [ "* = ****",
      "* =* ***",
      "* =** **",
      "* =*** *",
      "* =**** ",
      " *= ****",
      " *=* ***",
      " *=** **",
      " *=*** *",
      " *=**** " ]
c=0
while True:
    try:
        num = int(input())
    except EOFError:
        break

    if c > 0:
        print()
    c += 1

    str = "{:05}".format(num)
    s = [int(x) for x in list(str)]
    for i in range(len(L[0])):
        t = []
        for j in range(len(s)):
            t.append(L[s[j]][i])
        print("".join(t))

Python: from sys import stdout


def upper(n):
    if n < 5:
        return ['*', ' ']
    else:
        return [' ', '*']


def lower(n):
    m = n % 5
    return ['*'] * m + [' '] + ['*'] * (4 - m)


def abacus(n):
    return upper(n) + ['='] + lower(n)


while True:
    try:
        ns = map(int, ('00000' + raw_input().strip())[-5:])
    except EOFError:
        break

    ab = []
    for n in ns:
        ab.append(abacus(n))

    res = []
    for i in range(8):
        for j in range(5):
            res.append(ab[j][i])
        res.append('\n')
    res.append('\n')

    stdout.write(''.join(res[:-1]))

Python: f=0
while 1:
    try:n=int(input())
    except:break
    if f:print()
    f=1
    a=[[0 for _ in range(5)]for _ in range(8)]
    for i in range(4,-1,-1):
        b=n%10
        a[b//5][i]=1
        a[b%5+3][i]=1
        n//=10
    for i in range(8):
        for j in range(5):
            if i==2:print('=',end='')
            else:print(' ' if a[i][j] else '*',end='')
        print()

Python: from sys import stdout


def upper(n):
    m = n // 5
    if m == 0:
        return list("* ")
    else:
        return list(" *")


def lower(n):
    m = n % 5
    a = ['*'] * m + [' ']
    a = a + ['*'] * (5 - len(a))
    return a


def abacus(n):
    return upper(n) + ['='] + lower(n)


while True:
    try:
        line = "{0:05d}".format(int(raw_input()))
    except EOFError:
        break

    ab = []
    for c in line:
        ab.append(abacus(int(c)))

    for i in range(8):
        for j in range(len(ab)):
            stdout.write(ab[j][i])
        stdout.write("\n")

    print

Python: # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0128

"""
import sys
from sys import stdin
input = stdin.readline


def conv_avacus(num_txt):
    abacus = ['* = ****', '* =* ***', '* =** **', '* =*** *', '* =**** ',
              ' *= ****', ' *=* ***', ' *=** **', ' *=*** *', ' *=**** ']
    ans = [abacus[int(num_txt[4])], abacus[int(num_txt[3])], abacus[int(num_txt[2])], abacus[int(num_txt[1])], abacus[int(num_txt[0])]]
    return ans


def rotate_and_print(data):
    y_size = len(data)
    x_size = len(data[0])
    A = [[''] * y_size for _ in range(x_size)]
    for i in range(x_size):
        for j in range(y_size):
            A[i][j] = data[y_size-1-j][i]

    for l in A:
        print(''.join(l))


def main(args):
    first_case = True
    for line in sys.stdin:
        if not first_case:
            print()
        num_txt = line.strip().zfill(5)
        result = conv_avacus(num_txt)
        rotate_and_print(result)
        first_case = False


if __name__ == '__main__':
    main(sys.argv[1:])

Python: abacus = ["* = ****", "* =* ***", "* =** **", "* =*** *", "* =**** ",
          " *= ****", " *=* ***", " *=** **", " *=*** *", " *=**** "]
flag=0
while 1:
    try:N=input()
    except:break
    if flag:print()
    else:flag=1
    N=list(N.zfill(5))
    answer=[]
    for i in N:answer.append(list(abacus[int(i)]))
    answer=[list(x) for x in zip(*answer)]
    for i in range(8):print("".join(answer[i]))

Python: f=0
while 1:
    try:n=int(input())
    except:break
    if f:print()
    f=1
    a=[['*' for _ in range(5)]for _ in range(8)]
    for i in range(4,-1,-1):
        b=n%10
        a[not b//5][i]=' '
        a[b%5+3][i]=' '
        n//=10
    a[2]='='*5
    for i in a:
        print(''.join(i))

Python: from sys import stdout


def upper(n):
    if n < 5:
        return ['*', ' ']
    else:
        return [' ', '*']


def lower(n):
    m = n % 5
    return ['*'] * m + [' '] + ['*'] * (4 - m)


def abacus(n):
    return upper(n) + ['='] + lower(n)


res = []
while True:
    ns = map(int, ('00000' + raw_input().strip())[-5:])
    if ns == [0, 0, 0, 0, 0]:
        break

    ab = []
    for n in ns:
        ab.append(abacus(n))

    for i in range(8):
        for j in range(5):
            res.append(ab[j][i])
        res.append('\n')
    res.append('\n')

stdout.write(''.join(res[:-1]))