#include <stdio.h>
#include <cstdlib>

int main(void) {
  int n,  m;
  scanf("%i %i", &n, &m);
  
  int a[n], b[n];
  for (int i = 0; i < n; i++) {
    scanf("%i %i", &a[i], &b[i]);
  }
  
  int c[m], b[m];
  for (int i = 0; i < m; i++) {
    scanf("%i %i", &c[i], &d[i]);
  }
  
  for (int i = 0; i < n; i++) {
    int best = 1 << 30, idx = -1;
    for (int j = 0; j < m; j++) {
      int d = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (d < best) {
        best = d;
        idx = j;
      }
    }
    
    printf("%i\n", j + 1);
  }
  
  return 0;
}