#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main(){
    int n,m;
    cin>>n>>m;
    int a[n],b[n],c[m],d[m],ans[n]={},manmin[n]={};
    REP(i,n)cin>>a[i]>>b[i];
    REP(i,m)cin>>c[i]>>d[i];
    REP(i,n){
        REP(j,m){
            if(manmin[i]==0 and ans[i]==0){
                manmin[i]=abs(a[i]-c[j])+abs(b[i]-d[j]);
                ans[i]=j;
            }
            if((abs(a[i]-c[j])+abs(b[i]-d[j]))<manmin[i] and ans[i]<j){
                ans[i]=j;
                manmin[i]=abs(a[i]-c[j])+abs(b[i]-d[j]);
            }
        }
    }
    REP(i,n)cout<<ans[i]+1<<endl;
}