#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  int A[100][2], B[100][2];
  for (int i = 0; i < N; i++) {
    int a, b;
    cin >> a >> b;
    A[i][0] = a;
    A[i][1] = b;
  }
  for (int i = 0; i < M; i++) {
    int a, b;
    cin >> a >> b;
    B[i][0] = a;
    B[i][1] = b;
  }
  for (int i = 0; i < N; i++) {
    int d[M];
    int pre = 0;
    int ans = 30000;
    for (int j = 0; j < M; j++) {
      d[i] = abs(A[i][0] - B[j][0]) + abs(A[i][1] - B[j][1]);
      if (pre > d[i]) {
        ans = j;
        pre = d[i];
      }
    }
    cout << ans + 1 << endl;
  }
}
