def printSoroban(data)
  for line in 0...data.size
    for raw in 0...data[0].size
      print data[line][raw]
    end
    print "\n"
    puts "=====" if  line == 1
  end
end

def createData(value)
  data =  [[],[],[],[],[]],
          [[],[],[],[],[]],
          [[],[],[],[],[]],
          [[],[],[],[],[]],
          [[],[],[],[],[]],
          [[],[],[],[],[]],
          [[],[],[],[],[]]
            
  for digit in 0...value.size
    #そろばんの上
    if  value[digit] /5 == 1
      data[0][digit] = " "
      data[1][digit] = "*"
    else
      data[0][digit] = "*"
      data[1][digit] = " "
    end
    #そろばんの下
    for raw in 2...data.size
      if  raw == value[digit] % 5 + 2
        data[raw][digit] = " "
      else
        data[raw][digit] = "*"
      end
    end
  end
  
  return data
end

while input = gets
  n = input.to_i
  value = []
  value << n / 10000
  value << (n % 10000) / 1000
  value << (n % 1000) / 100
  value << (n % 100) / 10
  value << n % 10
  printSoroban(createData(value))
  puts ""
end