int main() { int i,j,m,n,t,p,q,k; while(scanf("%d %d",&m,&n)==2) { for(k=0;k