N,W = map(int, input().split()) VW = [list(map(int, input().split())) for _ in range(N)] ans = -1 for v,w in VW: if ans