#include <bits/stdc++.h>
int main() {
  int M;
  int N;
  long long a[50];
  long long b[50];
  long long c[50];
  long long d[50];
  long long distance[50];
  int index[50];
  long long mindistance;
  long long temp;
  int i;
  int j;
  scanf("%d %d", &N, &M);
  for (i = 0; i < N; i++) scanf("%lld %lld", &a[i], &b[i]);
  for (i = 0; i < M; i++) scanf("%lld %lld", &c[i], &d[i]);
  for (i = 0; i < N; i++) {
    mindistance = 10000000000;
    for (j = 0; j < N; j++) {
      temp = a[i] - c[j];
      if (temp < 0) temp = -1 * temp;
      distance[j] = temp;
      temp = b[i] - d[j];
      if (temp < 0) temp = -1 * temp;
      distance[j] += temp;
      if (distance[j] < mindistance) {
        index[i] = j + 1;
        mindistance = distance[j];
      }
    }
    printf("%d\n", index[i]);
  }
  return 0;
}
