#include <bits/stdc++.h>
using namespace std;
int main () {
  int N, M;
  cin >> N >> M;
  vector<pair<int,int>> human(N), check(M);
  for(int i = 0; i < N; i++) {
    cin >> human.at(i).first >> human.at(i).second;
  }
  for(int i = 0; i < M; i++) {
    cin >> check.at(i).first >> check.at(i).second;
  }
  long ans, num, sub;
  for(int i = 0; i < N; i++) {
    ans = 10000000000, num = -1;
    for(int j = 0; j < M; j++) {
      sub = abs(human.at(i).first - check.at(j).first) + abs(human.at(i).second - check.at(j).second);
      if(ans > sub) {
        ans = sub;
        num = j + 1;
      }
    }
    cout << nm << endl;
  }
  return 0;
}