#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  double comp = 10000000, tmp = 0;
  cin >> N >> M;
  vector<vector<double>> g(N, vector<double>(2));
  vector<vector<double>> p(M, vector<double>(2));
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 2; j++) {
      cin >> g.at(i).at(j);
    }
  }
  for (int i = 0; i < M; i++) {
    for (int j = 0; j < 2; j++) {
      cin >> p.at(i).at(j);
    }
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      if (comp > abs(g.at(i).at(0) - p.at(j).at(0)) +
                     abs(g.at(i).at(1) - p.at(j).at(1))) {
        comp = abs(g.at(i).at(0) - p.at(j).at(0)) +
               abs(g.at(i).at(1) - p.at(j).at(1));
        tmp = j + 1;
      }
    }
    cout << tmp << endl;
    comp = 10000000;
  }
}
