e,m,d=30000,0,0 for i in range(int(input())): G,D=map(int,input().split()) if m=e*50])