#include<bits/stdc++.h>

using namespace std;

using int64 = long long;
const int64 INF = 1LL << 60;

int main() {
  int64 N, M, A[50], B[50], C[50], D[50];
  cin >> N >> M;
  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 near = INF;
    for(int j = 0; j < M; j++) {
      near = min(near, abs(A[i] - C[j]) + abs(B[i] - D[j]));
    }
    for(int j = 0; j < M; j++) {
      if(near == abs(A[i] - C[j]) + abs(B[i] - D[j])) {
        cout << j + 1 << endl;
        break;
      }
    }
  }
}

