n,m=map(int,input().split()) v,w=0,0 for i in range(m): t,p=map(int,input().split()) if abs(t-v)