#include <bits/stdc++.h>
int N;
int M;
struct point {
  int x;
  int y;
};
point student[50];
point check[50];
unsigned int s;
struct sum {
  unsigned int s_min;
  int number;
} result[50];
int i, j;
int main() {
  std::cin >> N >> M;
  for (i = 0; i < N; i++) {
    result[i].s_min = 100000000;
    std::cin >> student[i].x >> student[i].y;
  }
  for (j = 0; j < M; j++) {
    std::cin >> check[j].x >> check[j].y;
  }
  for (i = 0; i < N; i++) {
    for (j = 0; j < M; j++) {
      s = std::abs(student[i].x - check[j].x) +
          std::abs(student[i].y - check[j].y);
      if (s < result[i].s_min) {
        result[i].s_min = s;
        result[i].number = j + 1;
      }
    }
  }
  for (i = 0; i < N; i++) {
    std::cout << result[i].number << '\n';
  }
  return (0);
}
