#include <bits/stdc++.h>
using namespace std;
long long mdist(pair<long, long> a, pair<long, long> b) {
  return (
      (((a.first - b.first) < 0) ? -(a.first - b.first) : (a.first - b.first)) +
      (((a.second - b.second) < 0) ? -(a.second - b.second)
                                   : (a.second - b.second)));
}
int main() {
  int n, m;
  long long a, b;
  long long dist;
  pair<long long, long long> check;
  pair<long long, long long> student[50];
  pair<long long, int> checkpoint[50];
  for (int i = 0; i < 50; i++) {
    checkpoint[i].first = LLONG_MAX;
    checkpoint[i].second = -1;
  }
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    student[i].first = a;
    student[i].second = b;
  }
  for (int i = 1; i <= m; i++) {
    cin >> a >> b;
    check = make_pair(a, b);
    for (int j = 0; j < n; j++) {
      dist = mdist(check, student[j]);
      if (dist < checkpoint[j].first) {
        checkpoint[j].first = dist;
        checkpoint[j].second = i;
      }
    }
  }
  for (int i = 0; checkpoint[i].second != -1 && i < 50; i++) {
    cout << checkpoint[i].second << endl;
  }
  return 0;
}
