#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int> > p;
  vector<pair<int, int> > q;
  for (int i = 0; i < (N); i++) {
    int first, second = 0;
    cin >> first >> second;
    pair<int, int> pr = make_pair(first, second);
    p.push_back(pr);
  }
  for (int i = 0; i < (M); i++) {
    int first, second = 0;
    cin >> first >> second;
    pair<int, int> pq = make_pair(first, second);
    q.push_back(pq);
  }
  int dn[M];
  int currmin = 10e5;
  int sol[N];
  int lest = -1;
  for (int i = 0; i < N; i++) {
    currmin = 10e5;
    lest = -1;
    int xa = p[i].first;
    int ya = p[i].second;
    for (int j = 0; j < M; j++) {
      if (dn[j] == 1) continue;
      int xb = q[j].first;
      int yb = q[j].second;
      int man = (abs(xa - xb) + abs(ya - yb));
      if (man < currmin) {
        currmin = man;
        lest = j;
      }
    }
    if (lest >= 0 && lest < M) dn[lest] = 1;
    sol[i] = lest;
  }
  for (int i = 0; i < (N); i++) {
    cout << sol[i] + 1 << endl;
  }
  return 0;
}
