#include <bits/stdc++.h>
using namespace std;
int absolute(int a, int b) {
  if (a - b < 0)
    return b - a;
  else
    return a - b;
}
int Manha(vector<int> a, vector<int> b) {
  return absolute(a.at(0), b.at(0)) + absolute(a.at(1), b.at(1));
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<vector<int>> place(N, vector<int>(2));
  for (int i = 0; i < N; i++) {
    cin >> place.at(i).at(0) >> place.at(i).at(1);
  }
  vector<vector<int>> point(M, vector<int>(2));
  for (int i = 0; i < M; i++) {
    cin >> point.at(i).at(0) >> point.at(i).at(1);
  }
  for (int i = 0; i < N; i++) {
    int localmin = 100000001;
    int temp = 51;
    for (int j = 0; j < M; j++) {
      if (Manha(place.at(i), point.at(j)) < localmin) {
        localmin = Manha(place.at(i), point.at(j));
        temp = j;
      } else if (Manha(place.at(i), point.at(j)) == localmin) {
        temp = min(temp, j);
      }
    }
    cout << temp + 1 << endl;
  }
}
