#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
constexpr int INF = 0x3f3f3f3f;
const long long mod = 1e9 + 7;
const long double PI = acos(-1);
ll calc(ll x1, ll y1, ll x2, ll y2) { return abs(x1 - x2) + abs(y1 - y2); }
int main() {
  ll n, m;
  cin >> n >> m;
  vector<P> x(n);
  vector<P> y(m);
  for (ll i = 0; i < n; i++) {
    ll a, b;
    cin >> a >> b;
    x[i].first = a;
    x[i].second = b;
  }
  for (ll i = 0; i < m; i++) {
    ll c, d;
    cin >> c >> d;
    y[i].first = c;
    y[i].second = d;
  }
  for (auto k : x) {
    ll min = INF, ans;
    for (ll i = 0; i < m; i++) {
      ll dist = calc(k.first, k.second, y[i].first, y[i].second);
      if (dist < min) {
        min = dist;
        ans = i + 1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
