#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  for (ll i = (0), __last_i = (v.size()); i < __last_i; i++) {
    if (i) os << " ";
    os << v[i];
  }
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
  for (ll i = (0), __last_i = (v.size()); i < __last_i; i++) {
    if (i) os << endl;
    os << v[i];
  }
  return os;
}
int main() {
  ll n, m;
  cin >> n >> m;
  vector<ll> a(n), b(n), c(m), d(m);
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  for (int j = 0; j < m; j++) {
    cin >> c[j] >> d[j];
  }
  for (int i = 0; i < n; i++) {
    ll min_dist = 1e8;
    for (int j = 0; j < m; j++) {
      ll dist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      min_dist = min(min_dist, dist);
    }
    for (int j = 0; j < m; j++) {
      ll dist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (min_dist == dist) {
        cout << j + 1 << endl;
        break;
      }
    }
  }
}
