prev = false

while (line = gets)
  n = line.strip.to_i

  ds = []
  for i in (0..4)
    ds.unshift n % 10
    n /= 10
  end

  puts if prev
  prev = true

  puts ds.map{|d| d < 5 ? '*' : ' '}.join("")
  puts ds.map{|d| d > 4 ? '*' : ' '}.join("")
  puts ds.map{'='}.join("")
  puts ds.map{|d| d % 5 != 0 ? '*' : ' '}.join("")
  puts ds.map{|d| d % 5 != 1 ? '*' : ' '}.join("")
  puts ds.map{|d| d % 5 != 2 ? '*' : ' '}.join("")
  puts ds.map{|d| d % 5 != 3 ? '*' : ' '}.join("")
  puts ds.map{|d| d % 5 != 4 ? '*' : ' '}.join("")
end