#include <bits/stdc++.h>
static int_fast32_t fastabs(int_fast32_t v) { return (v < 0) ? -v : v; }
int main(void) {
  size_t n, m;
  scanf("%zu %zu", &n, &m);
  int_fast32_t x[51][2];
  for (size_t i = 0; i < n; ++i) {
    scanf("%" SCNdFAST32 " %" SCNdFAST32, &x[i][0], &x[i][1]);
  }
  int_fast32_t y[51][2];
  for (size_t i = 0; i < n; ++i) {
    scanf("%" SCNdFAST32 " %" SCNdFAST32, &y[i][0], &y[i][1]);
  }
  for (size_t i = 0; i < n; ++i) {
    size_t index = 0;
    int_fast32_t minvalue = INT_FAST32_MAX;
    for (size_t j = 0; j < m; ++j) {
      int_fast32_t value =
          fastabs(x[i][0] - y[j][0]) + fastabs(x[i][1] - y[j][1]);
      if (value < minvalue) {
        minvalue = value;
        index = j + 1;
      }
    }
    printf("%" PRIdFAST32 "\n", index);
  }
  return 0;
}
