import Control.Monad
import Data.Array
import Data.List
main = do
  [n,k] <- map read . words <$> getLine
  abs <- replicateM n $ map read . words <$> getLine
  let ar = accumArray (+) 0 (1,10^5) [(a,b) | [a,b] <- abs]
      (Just i) = findIndex (>=k) $ scanl1 (+) $ elems $ ar
  print (i+1)