#include <bits/stdc++.h>
using namespace std;
int mod = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> v(n);
  vector<pair<int, int>> vv(n);
  for (int i = 0; i < n; i++) cin >> v[i].first >> v[i].second;
  for (int i = 0; i < m; i++) cin >> vv[i].first >> vv[i].second;
  for (int i = 0; i < n; i++) {
    int minn = 1e9;
    ;
    int minnum;
    for (int j = m - 1; j >= 0; j--) {
      if (minn >=
          abs(vv[j].first - v[i].first) + abs(vv[j].second - v[i].second)) {
        minn = abs(vv[j].first - v[i].first) + abs(vv[j].second - v[i].second);
        minnum = j;
      }
    }
    cout << minnum + 1 << endl;
  }
  return 0;
}
