#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> N1;
  vector<int> N2;
  vector<int> M1;
  vector<int> M2;
  vector<int> mn;
  vector<int> a;
  int N, M, in, mi, value, s, b, d, c, i, j;
  while (cin >> N >> M) {
    while (N--) {
      cin >> s >> b;
      N1.push_back(s);
      N2.push_back(b);
    }
    while (M--) {
      cin >> c >> d;
      M1.push_back(c);
      M2.push_back(d);
    }
    for (i = 0; i < N1.size(); i++) {
      for (j = 0; j < M1.size(); j++) {
        value = fabs(N1[i] - M1[j]) + fabs(N2[i] - M2[j]);
        a.push_back(value);
      }
      mi = a[0];
      in = 1;
      for (j = 0; j < a.size(); j++) {
        if (mi > a[j]) {
          in = j + 1;
        }
      }
      mn.push_back(in);
      a.clear();
    }
    for (i = 0; i < mn.size(); i++) cout << mn[i] << endl;
    N1.clear();
    N2.clear();
    M1.clear();
    M2.clear();
    mn.clear();
    a.clear();
  }
  return 0;
}
