#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int long long, int long long> > v;
  vector<pair<int long long, int long long> > vv;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    v.push_back(make_pair(a, b));
  }
  int ans[n];
  for (int k = 0; k < m; k++) {
    int long long c, d;
    cin >> c >> d;
    vv.push_back(make_pair(c, d));
  }
  for (int i = 0; i < n; i++) {
    int mi = 100000001;
    int mians = 0;
    for (int j = 0; j < m; j++) {
      int long long u =
          abs(v[i].first - vv[j].first) + abs(v[i].second - vv[j].second);
      if (u < mi) {
        mians = j + 1;
        mi = u;
      }
    }
    ans[i] = mians;
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
