#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<long long int, long long int>> student(n);
  vector<pair<long long int, long long int>> check(m);
  for (int i = int(0); i < int(n); ++i) {
    cin >> student[i].first;
    cin >> student[i].second;
  }
  for (int i = int(0); i < int(m); ++i) {
    cin >> check[i].first;
    cin >> check[i].second;
  }
  vector<int> ans(n);
  for (int i = int(0); i < int(n); ++i) {
    long long int k = 1000;
    for (int j = int(0); j < int(m); ++j) {
      long long int now = abs(student[i].first - check[j].first) +
                          abs(student[i].second - check[j].second);
      if (now < k) {
        k = min(now, k);
        ans[i] = j;
      }
    }
  }
  for (int i = int(0); i < int(n); ++i) {
    cout << ans[i] + 1 << endl;
  }
  return 0;
}
