#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, i, j, min, ans;
  cin >> N >> M;
  vector<int> a(N + 1);
  vector<int> b(N + 1);
  vector<int> c(M + 1);
  vector<int> d(M + 1);
  for (i = 1; i <= N; i++) cin >> a.at(i) >> b.at(i);
  for (i = 1; i <= M; i++) cin >> c.at(i) >> d.at(i);
  vector<vector<int>> distance(N + 1, vector<int>(M + 1));
  for (i = 1; i <= N; i++) {
    for (j = 1; j <= M; j++) {
      distance.at(i).at(j) = abs(a.at(i) - c.at(j)) + abs(b.at(i) - d.at(j));
    }
  }
  for (i = 1; i <= N; i++) {
    min = 200000000;
    for (j = 1; j <= M; j++) {
      if (distance.at(i).at(j) < min) {
        min = distance.at(i).at(j);
        ans = j;
      }
    }
    cout << ans << endl;
  }
}
