gx, gy = gets.split.map(&:to_i) px, py = gets.split.map(&:to_i) if gx.abs == gy.abs && px / gx == py / gy && px / gx < 1 [gx.abs,gy.abs].max + 1 else [gx.abs,gy.abs].max end