class Integer;alias:-:*end n,t,*a=$<.read.split.map &:to_i s=a*'%s' n.times.any?{|i|k=n.times.map{|j|'+-'[i[j]]};eval(s%k)==t&&$><<(k*'').tr(?-,?*)}