#include <bits/stdc++.h>
using namespace std;
int A[55], B[55], C[55], D[55];
int main() {
  int N, M;
  cin >> N >> M;
  for (int i = 1; i <= N; i++) cin >> A[i] >> B[i];
  for (int i = 1; i <= M; i++) cin >> C[i] >> D[i];
  for (int i = 1; i <= N; i++) {
    int id = -1;
    long long min_dist = 10000000000000ll;
    for (int j = 1; j <= N; j++) {
      long long curr_dist = abs(C[j] - A[i]) + abs(D[j] - B[i]);
      if (curr_dist < min_dist) {
        min_dist = curr_dist;
        id = j;
      }
    }
    cout << id << endl;
  }
}
