#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N;
  cin >> M;
  double *ai = new double[N];
  double *bi = new double[N];
  double *ci = new double[M];
  double *di = new double[M];
  int *cp = new int[N];
  for (int i = 0; i < N; i++) {
    cin >> ai[i];
    cin >> bi[i];
  }
  for (int i = 0; i < M; i++) {
    cin >> ci[i];
    cin >> di[i];
  }
  double min, dis;
  int mincp;
  for (int i = 0; i < N; i++) {
    double a = ai[i], b = bi[i];
    min = abs(a - ci[0]) + abs(b - di[0]);
    mincp = 0;
    for (int j = 1; j < M; j++) {
      dis = abs(a - ci[j]) + abs(b - di[j]);
      if (min > dis) {
        min = dis;
        mincp = j;
      }
    }
    cp[i] = mincp + 1;
  }
  for (int i = 0; i < N; i++) cout << cp[i] << endl;
  delete[] ai;
  delete[] bi;
  delete[] ci;
  delete[] di;
  return 0;
}
