#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
const double EPS = 1e-9;
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1},
          dy[] = {0, -1, 0, 1, 1, -1, -1, 1};
int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int> > A(N), C(M);
  for (int i = 0; i < N; i++) {
    int a, b;
    cin >> a >> b;
    A[i] = {a, b};
  }
  for (int i = 0; i < M; i++) {
    int c, d;
    cin >> c >> d;
    C[i] = {c, d};
  }
  for (int i = 0; i < N; i++) {
    int mi = 1e8 + 1, mi_j;
    for (int j = 0; j < M; j++) {
      int d = abs(C[j].first - A[i].first) + abs(C[j].second - A[i].second);
      if (mi > d) {
        mi_j = j;
        mi = d;
      }
    }
    cout << mi_j + 1 << endl;
  }
  return 0;
}
