#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, M;
  cin >> N >> M;
  int stuX[N], stuY[N];
  int checkX[M], checkY[M];
  for (int i = 0; i < N; i++) cin >> stuX[i] >> stuY[i];
  for (int i = 0; i < M; i++) cin >> checkX[i] >> checkY[i];
  double dis = INFINITY;
  int number;
  for (int i = 0; i < N; i++) {
    dis = INFINITY;
    number = 0;
    for (int j = M - 1; j >= 0; j--) {
      if (dis >= sqrt(pow(abs(stuX[i] - checkX[j]), 2) +
                      pow(abs(stuY[i] - checkY[j]), 2))) {
        dis = sqrt(pow(abs(stuX[i] - checkX[j]), 2) +
                   pow(abs(stuY[i] - checkY[j]), 2));
        number = j + 1;
      }
    }
    cout << number << endl;
  }
  return 0;
}
