#include <bits/stdc++.h>
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  double a[50], b[50], c[50], d[50];
  double h = pow(10, 8), i, g;
  for (int k = 0; k < n; k++) {
    scanf("%lf%lf", &a[k], &b[k]);
  }
  for (int k = 0; k < m; k++) {
    scanf("%lf%lf", &c[k], &d[k]);
  }
  for (int e = 0; e < n; e++) {
    for (int f = 0; f < m; f++) {
      g = sqrt(pow((a[e] - c[f]), 2) - pow(b[e] - d[f], 2));
      if (h > g) {
        h = g;
        i = f + 1;
      }
    }
    printf("%f\n", i);
  }
  return 0;
}
