#include <string>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>

using namespace std;

typedef pair<int, int> coord;

int distance(int x1, int y1, int x2, int y2)
{
  return abs(x1 - x2) + abs(y1 - y2);
}

int main()
{
  int N, M;
  cin >> N >> M;
  vector<coord> students(N);
  vector<coord> checkpoints(M);
  vector<coord> answers(N);
  for (int i = 0; i < N; ++i) cin >> students[i].first >> students[i].second;
  for (int i = 1; i <= M; ++i) {
    int x, y;
    cin >> x >> y;
    for (int j = 0; j < N; ++j) {
      int dist = distance(x, y, students[j].first, students[j].second);
      if (answers[j].first == 0 or dist < answers[j].second) {
        answers[j].first = i;
        answers[j].second = dist;
      }
    }
  }
  for (const auto answer: answers) cout << answer.first << endl;
  return 0;
}
