#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>> e(100,vector<long>(100);
  vector<long> f(100,1000000000);
  int g[100];
 
  for(int i=1; i<=n; i++){
   for(int j=1; j<=m; j++){
    e[i][j] = abs(a[i]-c[j])+abs(b[i]-d[j]);
     if(f[i] > e[i][j]) {
       f[i] = e[i][j];
       g[i] = j;
     }
   }
  }
 for(int i=1; i<=n; i++) cout << g[i] << endl;
  
  
  
}