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