#include <bits/stdc++.h>
int main() {
  int n = 0, m = 0, d[50] = {}, ans = 99999999;
  int box = 99999999;
  int people[50][2] = {};
  int check[50][2] = {};
  std::cin >> n >> m;
  for (int i = 0; i < n; i++) {
    std::cin >> people[i][0];
    std::cin >> people[i][1];
  }
  for (int j = 0; j < m; j++) {
    std::cin >> check[j][0];
    std::cin >> check[j][1];
  }
  for (int a = 0; a < n; a++) {
    for (int b = 0; b < m; b++) {
      d[b] = std::abs(people[a][0] - check[b][0]) +
             std::abs(people[a][1] - check[b][1]);
      if (d[b] < box) {
        box = d[b];
        ans = b + 1;
      }
    }
    std::cout << ans << std::endl;
    box = 99999999;
  }
}
