gets e=gets.split.map &:to_i d=[0,-1,0,1] c=[] until d.size>e.size d.size.times{|i|e[i+e.size-d.size]-=d[i]*(c<1&&e[-1]==0 p e.size-1 puts e*' '