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

10000000.times do |i|
  s = gets
  break unless s
  puts (i==0?"":"\n") + sprintf("%05s",s).split('').map{|i|arr[i.to_i].split ''}.transpose.map{|s|s.reverse.join}.join("\n")
end