#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int A[50], B[50], C[50], D[50];
  for (int i = 0; i < n; i++) {
    cin >> A[i] >> B[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> C[i] >> D[i];
  }
  for (int i = 0; i < n; i++) {
    int min_dist = abs(A[i] - C[0]) + abs(B[i] - D[0]), checkpoints = 1;
    for (int j = 1; j < m; j++) {
      const int cur_dist = abs(A[i] - C[j]) + abs(B[i] - D[i]);
      if (min_dist > cur_dist) {
        min_dist = cur_dist;
        checkpoints = j + 1;
      }
    }
    cout << checkpoints << endl;
  }
}
