#include <bits/stdc++.h>
int main(void) {
  int n, m, count, l;
  long a1[50], b1[50], sum, min = 200000000;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < 2 * n; i++) scanf("%d", &a1[i]);
  for (int i = 0; i < 2 * m; i++) scanf("%d", &b1[i]);
  for (int i = 0; i <= 2 * n - 2; i += 2) {
    count = 0;
    min = 200000000;
    for (int j = 0; j <= 2 * m - 2; j += 2) {
      sum = abs(a1[i] - b1[j]) + abs(a1[i + 1] - b1[j + 1]);
      if (sum < min) {
        min = sum;
        l = count + 1;
      }
      count++;
    }
    printf("%d\n", l);
  }
  return 0;
}
