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