#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> person;
  vector<pair<int, int>> points;
  vector<int> result;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    person.push_back(make_pair(x, y));
  }
  for (int j = 0; j < m; j++) {
    int x, y;
    cin >> x >> y;
    points.push_back(make_pair(x, y));
  }
  for (auto&& p : person) {
    int len = pow(10, 8);
    int resultnum;
    int num = 1;
    for (auto&& point : points) {
      int temp = abs(p.first - point.first) + abs(p.second - point.second);
      if (len > temp) {
        len = temp;
        resultnum = num;
      }
      num++;
    }
    result.push_back(resultnum);
  }
  for (int r : result) {
    cout << r << endl;
  }
  return 0;
}
