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