#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  pair<int, int> ab[50];
  for (int i = 0; i < N; ++i) {
    cin >> ab[i].first >> ab[i].second;
  }
  pair<int, int> cd[50];
  for (int i = 0; i < M; ++i) {
    cin >> cd[i].first >> cd[i].second;
  }
  for (int i = 0; i < N; ++i) {
    int min = 10000, ans = 0;
    for (int j = 0; j < M; ++j) {
      int tmp =
          abs(ab[i].first - cd[j].first) + abs(ab[i].second - cd[j].second);
      if (tmp < min) {
        min = tmp;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
