#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n, m, a[50], b[50], c[50], d[50];
  cin >> n >> m;
  for (i = 0; i < n; i++) cin >> a[i], cin >> b[i];
  for (i = 0; i < m; i++) cin >> c[i], cin >> d[i];
  for (i = 0; i < n; i++) {
    int mi, mx = 100000001;
    for (j = 0; j < m; j++) {
      int md = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (md < mx) mi = j + 1, mx = md;
    }
    cout << mi << endl;
  }
  return 0;
}
