#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  vector<vector<long long int>> stu(n, vector<long long int>(2));
  vector<vector<long long int>> check(m, vector<long long int>(2));
  for (int i = 0; i < (int)(n); i++) cin >> stu.at(i).at(0) >> stu.at(i).at(1);
  for (int i = 0; i < (int)(m); i++)
    cin >> check.at(i).at(0) >> stu.at(i).at(1);
  long long int out;
  long long int MIN;
  long long int tmp;
  for (int i = 0; i < (int)(n); i++) {
    MIN = abs(stu.at(i).at(0) - check.at(0).at(0)) +
          abs(stu.at(i).at(1) - check.at(0).at(1));
    for (int j = 0; j < (int)(m); j++) {
      tmp = abs(stu.at(i).at(0) - check.at(j).at(0)) +
            abs(stu.at(i).at(1) - check.at(j).at(1));
      if (tmp < MIN) {
        out = j + 1;
        MIN = tmp;
      }
    }
    cout << out << endl;
  }
  return 0;
}
