#include <bits/stdc++.h>
using namespace std;
int mDist(int student, int checkpoint, vector<int> &a, vector<int> &b,
          vector<int> &c, vector<int> &d) {
  return abs(a[student] - c[checkpoint]) + abs(b[student] - d[checkpoint]);
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n), b(n), c(n), d(n);
  for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
  for (int i = 0; i < m; i++) cin >> c[i] >> d[i];
  for (int i = 0; i < n; i++) {
    int min = 1000000000;
    int checkpoint = -1;
    for (int j = 0; j < m; j++) {
      int dist = mDist(i, j, a, b, c, d);
      if (dist < min) {
        checkpoint = j;
        min = dist;
      }
    }
    cout << checkpoint + 1 << endl;
  }
  return 0;
}
