#include <bits/stdc++.h>
using namespace std;
int Plus(int a) {
  if (a < 0) a = -a;
  return a;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > pii;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    pii.push_back(make_pair(a, b));
  }
  vector<int> ans;
  for (int i = 0; i < m; i++) {
    int a, b;
    int min = 2147483647;
    cin >> a >> b;
    int flag = -1;
    for (int j = 0; j < pii.size(); j++) {
      int c = Plus((a - pii[i].first));
      int d = Plus((b - pii[i].second));
      if (min > c + d) {
        min = c + d;
        flag = j + 1;
      }
    }
    ans.push_back(flag);
  }
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
