d=1 (0...gets.to_i).map{v,t=gets.split.map &:to_i;[v+t,v]}.sort.each{|a|d|=(d<