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