p -1;exit gets d = gets.split.map(&:to_i) x1,y1 = gets.split.map(&:to_i) z = [x1+y1,x1-y1].map(&:abs).max if z==0 p 0;exit end d.each{|de| if z==de p 1;exit end } dmax = d.max if (z