#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int n,m;
int func(int x){
  int best=INF;
  int ans;
  rep(i,m){
    if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
      best=abs(a[x]-c[i])+abs(b[x]-d[i]);
      ans=i;
    }
    return i+1;
  }
int main(){
  
  cin>>n>>m;
    vector<int>a(60),b(60),c(60),d(60);
    rep(i,n)cin>>a[i]>>b[i];
    rep(i,m)cin>>c[i]>>d[i];
  rep(i,n)
  cout<<func(i)<<endl;
}