#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[n], b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  int c[m], d[m];
  for (int i = 0; i < m; i++) {
    cin >> c[i] >> d[i];
  }
  int min = 9999, ans_index = 0;
  for (int i = 0; i < n; i++) {
    int k = 0;
    while (k < m) {
      if (min > (abs(a[i] - c[k]) + abs(b[i] - d[k]))) {
        min = (abs(a[i] - c[k]) + abs(b[i] - d[k]));
        ans_index = k + 1;
      }
      k++;
    }
    cout << ans_index << endl;
    min = 9999;
  }
  return 0;
}
