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