#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a[100], b[100], c[100], d[100], count = 0, sm, s;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
  for (int j = 0; j < m; j++) cin >> c[j] >> d[j];
  for (int k = 0; k < n; k++) {
    s = 1000000000000;
    sm = 0;
    for (int l = 0; l < m; l++) {
      count = abs(a[k] - c[l]) + abs(b[k] - d[l]);
      if (s > count) {
        sm = l;
        s = count;
      }
      count = 0;
    }
    cout << sm + 1 << endl;
    sm = 0;
  }
  return 0;
}
