#include <bits/stdc++.h>
using namespace std;
int64_t MOD = 1000000007;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> stu(n), che(m);
  for (int i = 0; i < n; i++) cin >> stu[i].first >> stu[i].second;
  for (int j = 0; j < m; j++) cin >> che[j].first >> che[j].second;
  for (int i = 0; i < n; i++) {
    int dist = 10000, ind;
    for (int j = 0; j < m; j++) {
      int cru =
          abs(stu[i].first - che[j].first) + abs(stu[i].second - che[j].second);
      if (dist > cru) {
        dist = cru;
        ind = j;
      }
    }
    ind++;
    cout << ind << endl;
  }
  return 0;
}
