a[99],c[99],p,v,i,j,n,m;main(k){for(;~scanf("%d%d",n?(i<n?a:c-n)+i++:&n,m?(i<n?a:c-n)+i+50:&m););for(;j<n;printf("%d\n",p,j++))for(v=1e9,p=i=0;i<m;v>k?p=i,v=k:0)k=abs(a[j]-c[i])+abs(a[j+50]-c[50+i++]);}