#!ruby -na $_="#{eval$F.map{|s|n=0 s.chars{|c|n=n*10+c.hex} n}*?+}" 0while$_.sub!(/(.+)0/){"#{$1.to_i-1}A"} ~/0?/ puts$'