#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> avec;
  vector<int> bvec;
  for (int(i) = 0; (i) < (n); (i)++) {
    int a, b;
    cin >> a >> b;
    avec.push_back(a);
    bvec.push_back(b);
  }
  vector<int> cvec;
  vector<int> dvec;
  for (int(i) = 0; (i) < (m); (i)++) {
    int c, d;
    cin >> c >> d;
    cvec.push_back(c);
    dvec.push_back(d);
  }
  for (int i = 0; i < n; i++) {
    int ans = 0;
    int tmp = 100000000;
    for (int j = m - 1; j >= 0; j--) {
      int tmp2 = (abs(avec[i] - cvec[j]) + abs(bvec[i] - dvec[j]));
      if (tmp2 <= tmp) {
        tmp = tmp2;
        ans = j;
      }
    }
    cout << ans + 1 << endl;
  }
}
