#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  int a[60], b[60], c[60], d[60];
  int i, j;
  for (i = 0; i < N; i++) {
    cin >> a[i] >> b[i];
  }
  for (i = 0; i < M; i++) {
    cin >> c[i] >> d[i];
  }
  long int dist;
  int point;
  for (i = 0; i < N; i++) {
    dist = pow(pow(a[i] - c[0], 2) + pow(b[i] - d[0], 2), 0.5);
    point = 0;
    for (j = 1; j < M; j++) {
      if (dist > pow(pow(a[i] - c[j], 2) + pow(b[i] - d[j], 2), 0.5)) {
        dist = pow(pow(a[i] - c[j], 2) + pow(b[i] - d[j], 2), 0.5);
        point = j;
      }
    }
    cout << point + 1 << endl;
  }
  return 0;
}
