#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, s, p;
  double q[52], a[52], b[52], c[52], d[52], l[52];
  cin >> n >> m;
  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++) {
    q[i] = 20000000000;
    for (int j = 0; j < n; j++) {
      if (a[i] >= c[j])
        s = a[i] - c[j];
      else
        s = c[j] - a[i];
      if (b[i] >= d[j])
        p = b[i] - d[j];
      else
        p = d[j] - b[i];
      if (s + p < q[i]) {
        l[i] = j + 1;
        q[i] = s + p;
      } else if (s + p == q[i]) {
        q[i] = s + p;
      }
    }
    cout << l[i] << endl;
  }
}
