#include<iostream>
#include<cstdlib>
#include<algorithm>
using namespace std;
int main(){
  int n,m;
  cin >> n >> m;
  long long int a[n],b[n];
  for(int i=0;i<n;i++) cin >> a[i] >> b[i];
  int c[m],d[m];
  for(int i=0;i<m;i++) cin >> c[i] >> d[i];
  for(int i=0;i<n;i++){
    long long int minl=200000001,minn=51;
    for(int j=0;j<m;j++){
      if(minl>=abs(a[i]-c[j])+abs(b[i]-d[j])){
        if(minl==abs(a[i]-c[j])+abs(b[i]-d[j]))minn=min(minn,j+1);
        else minn=j+1;
        minl=abs(a[i]-c[j])+abs(b[i]-d[j]);
      }      
    }
    cout << minn << endl;
  }
}