#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)1e9;
const long long MOD = (long long)1e9 + 7;
const long long LINF = (long long)1e18;
const double EPS = 1e-9;
signed main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  vector<pair<long long, long long>> student;
  for (long long i = 0; i < (n); ++i) {
    long long a, b;
    cin >> a >> b;
    student.push_back({a, b});
  }
  vector<pair<long long, long long>> point;
  for (long long i = 0; i < (m); ++i) {
    long long c, d;
    cin >> c >> d;
    point.push_back({c, d});
  }
  for (auto s : student) {
    long long ans = 0;
    long long distance = LINF;
    long long idx;
    for (auto p : point) {
      if (abs(s.first - p.first) + abs(s.second - p.second) < distance)
        ans = idx;
      ++idx;
    }
    cout << ans << endl;
  }
  return 0;
}
