#include long long n,m,i,j,x,y,a,t;int main(){for(scanf("%d%d",&n,&m);iy?x:y);}