#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > students;
  while (n--) {
    int a, b;
    cin >> a >> b;
    pair<int, int> stud = {a, b};
    students.push_back(stud);
  }
  vector<pair<int, int> > checkpoints;
  while (m--) {
    int c, d;
    cin >> c >> d;
    pair<int, int> check = {c, d};
    checkpoints.push_back(check);
  }
  pair<int, int> stud, check, min_manhattan = {-1, 100000000};
  int manhattan;
  for (int i = 0; i < students.size(); ++i) {
    stud = students[i];
    for (int j = 0; j < checkpoints.size(); ++j) {
      check = checkpoints[j];
      manhattan =
          abs(stud.first - check.first) + abs(stud.second - check.second);
      if (manhattan < min_manhattan.second) min_manhattan = {j + 1, manhattan};
    }
    cout << min_manhattan.first << endl;
    min_manhattan = {-1, 100000000};
  }
  return 0;
}
