#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  long long x, y;
  cin >> n >> m;
  vector<pair<long long, long long>> stud(n);
  vector<pair<long long, long long>> check(m);
  for (int i = 0; i < n; ++i) {
    cin >> x >> y;
    stud[i] = {x, y};
  }
  for (int i = 0; i < m; ++i) {
    cin >> x >> y;
    check[i] = {x, y};
  }
  for (int i = 0; i < n; ++i) {
    long long res = 1e18;
    int ans = 0;
    for (int j = 0; j < n; ++j) {
      long long dist = abs(check[j].first - stud[i].first) +
                       abs(check[j].second - stud[i].second);
      if (dist < res) {
        res = dist;
        ans = j;
      }
    }
    cout << ans + 1 << endl;
  }
  return 0;
}
