puts $<.map {|l|
    x = l.to_i
    a = []
    (0..4).each do |k|
        d = x / 10**k % 10
        u = d / 5
        l = d % 5
        a.unshift ((u == 0 ? "* =" : " *=") + ?**l + " " + ?**(4-l)).split("")
    end
    a.transpose.map(&:join).join("\n")
}.join "\n\n"