#include<iostream>
using namespace std;
int n, m;
int main(){
  cin >> n >> m;
  const int nm = 50;
  int a[nm], b[nm], c[nm], d[nm];
  for(int i = 0; i < n; i++) cin >> a[i] >> b[i];
  for(int i = 0; i < m; i++) cin >> c[i] >> d[i];
  
  for(int i = 0; i < n; i++){
    int minone = abs(a[i] - c[0]) + abs(b[i] - d[i]);
    int checkpoint = 1;
    for(int j = i; j < n; j++){
      int mintwo = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if(mintwo < minone) {
        minone = mintwo;
        checkpoint = j +1
      }
    }
    cout << checkpoint << endl;
  }
}