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

int main() {
  int n, m;
  cin >> n >> m;
  
  vector<int> a(n), b(n), c(m), d(m);
  for (int i=0; i<n; i++){
    cin >> a.at(i) >> b.at(i);
  }
  for (int i=0; i<m; i++){
    cin >> c.at(i) >> d.at(i);
  }
  
  for (int i=0; i<n; i++){
    int md = MAX_INT;
    int num;
    for (int j=0; j<m; j++){
      if(md > abs(a.at(i)-c.at(j))+abs(b.at(i)-d.at(j))){
        num = j;
        md =abs(a.at(i)-c.at(j))+abs(b.at(i)-d.at(j));
      }
    }
    cout << num << endl;
  }
  
  return 0;
}
