#include <bits/stdc++.h>
using namespace std;
 
int main(){

int N, M, num, mi;
  cin >> N >> M;
int a[N];
int b[N];
int c[M];
int d[M];
  
  for(int i = 0;i < N;i++){
  cin >> a[i];
  cin >> b[i];  
  }
  for(int i = 0;i < M;i++){
  cin >> c[i];
  cin >> d[i]; 
  }
  
  for(int j = 0;j < N;j++){
    mi = 200000001;
  for(int i = 0;i < M;i++){
  if(mi > abs(a[j] - c[i]) + abs(b[j] - d[i])){
  num = i + 1;
  mi = abs(a[j] - c[i]) + abs(b[j] - d[i]);  
  }
  }
        cout << num << endl;
  }
  
 