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