#include <bits/stdc++.h>
using namespace std;
vector<int> A, B, C, D;
int calu(int N, int M) {
  return abs(A.at(N) - C.at(M)) + abs(B.at(N) - D.at(M));
}
int main() {
  int(N);
  cin >> (N);
  int(M);
  cin >> (M);
  for (int a = 0; a < (N); ++a) {
    int(b);
    cin >> (b);
    int(c);
    cin >> (c);
    A.push_back(b);
    B.push_back(c);
  }
  for (int a = 0; a < (M); ++a) {
    int(b);
    cin >> (b);
    int(c);
    cin >> (c);
    C.push_back(b);
    D.push_back(c);
  }
  vector<int> ans;
  for (int a = 0; a < (N); ++a) {
    int K = 100000000;
    int w = 0;
    for (int b = 0; b < (M); ++b) {
      if (K > calu(a, b)) {
        K = calu(a, b);
        w = b + 1;
      }
    }
    ans.push_back(w);
  }
  for (int a = 0; a < (N); ++a) {
    cout << (ans.at(a)) << endl;
  }
  return 0;
}
