#include <bits/stdc++.h>
using namespace std;
bool compare_by_b(pair<string, int> a, pair<string, int> b) {
  if (a.second != b.second)
    return a.second < b.second;
  else
    return a.first < b.first;
}
int main() {
  int64_t n, m, mini = 10000000, number = 0;
  cin >> n >> m;
  vector<pair<int64_t, int64_t>> s(n);
  for (int i = 0; i < n; i++) cin >> s[i].first >> s[i].second;
  vector<pair<int64_t, int64_t>> d(m);
  for (int i = 0; i < m; i++) cin >> d[i].first >> d[i].second;
  vector<int> p;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (abs(s[i].first - d[j].first) + abs(s[i].second - d[j].second) <
          mini) {
        mini = abs(s[i].first - d[j].first) + abs(s[i].second - d[j].second);
        number = j + 1;
      }
    }
    cout << number << endl;
    number = 0;
    mini = 10000000;
  }
  return 0;
}
