R=range J=lambda:list(map(int,input().split())) Q,*_=J() X=[J()for q in R(Q)] L=202501 D=[[]for n in R(L)] for d in R(1,L): for n in R(d,L,d):D[n]+=[d] N=sorted((X[q][0],q)for q in R(Q)) Y=[1] def G(i):return Y[i]if 0<=i