#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  long long a, b;
  vector<pair<long long, long long>> students;
  for (int i = 0; i < N; ++i) {
    cin >> a >> b;
    students.push_back(make_pair(a, b));
  }
  vector<pair<long long, long long>> points;
  for (int i = 0; i < M; ++i) {
    cin >> a >> b;
    points.push_back(make_pair(a, b));
  }
  for (auto student : students) {
    long long min_dist = 20000000, min_index = -1;
    for (int i = 0; i < points.size(); ++i) {
      auto point = points[i];
      long long dist =
          abs(student.first - point.first) + abs(student.second - point.second);
      if (dist < min_dist) {
        min_dist = dist;
        min_index = i;
      }
    }
    cout << (min_index + 1) << endl;
  }
  return 0;
}
