#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  pair<long long, long long> ab[50], cd[50];
  for (int i = 0; i < n; i++) {
    cin >> ab[i].first >> ab[i].second;
  }
  for (int i = 0; i < m; i++) {
    cin >> cd[i].first >> cd[i].second;
  }
  long long far, old_far;
  vector<int> answer;
  int ans;
  for (int i = 0; i < n; i++) {
    far = 200000001;
    for (int j = 0; j < m; j++) {
      old_far = far;
      far =
          min(abs(ab[i].first - cd[j].first) + abs(ab[i].second - cd[j].second),
              far);
      if (old_far != far) {
        ans = j + 1;
      }
    }
    answer.push_back(ans);
  }
  for (int i = 0; i < answer.size(); i++) {
    cout << answer[i] << endl;
  }
  return 0;
}
