#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> p(N);
  vector<int> q(N);
  for (int i = 0; i < N; i++) {
    cin >> p[i] >> q[i];
  }
  for (int j = 0; j < M; j++) {
    int a, b;
    cin >> a >> b;
    int Z = 0, A = 2001924167;
    for (int i = 0; i < N; i++) {
      if (A > abs(a - p[i]) + abs(b - q[i])) {
        Z = i + 1;
        A = abs(a - p[i]) + abs(b - q[i]);
      }
    }
    cout << Z << endl;
  }
}
