arr = [
  "* = ****","* =* ***","* =** **","* =*** *","* =**** ",
  " *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** "
]

10000000.times do |i|
  s = gets
  break unless s
  puts "" if i!=0
  puts sprintf("%5d",s.to_i).split('').map{|i|arr[i.to_i].split ''}.transpose.map{|s|s.join}
end