#include <bits/stdc++.h>
using namespace std;

int main(){
  
  long n,m;
  cin >> n >> m;
  long a[100],b[100],c[100],d[100];
  for(int i=1; i<=n; i++) cin >>a[i]>>b[i];
  for(int i=1; i<=m; i++) cin >>c[i]>>d[i];
  
  vector<vector<long>> d(100,vector<long>(100,1000000000));
  long e[100],f[100];

  for(int i=1; i<=n; i++){
   for(int j=1; j<=m; j++){
    d[i][j] = abs(a[i]-c[i])+abs(b[i]-d[i]);
     if(e[i] > d[i][j]) {e[i]=d[i][j]; f[i] = j;}
   }
    for(int i=1; i<=n; i++) cout << f[i] << endl;
  }

}