#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const ll MOD = 1000000007;
const ll MOD2 = 998244353;
const ld PI = acos(-1);
const ll INF = 1e18;
struct edge {
  ll to, cost;
};
struct edge2 {
  ll from, to, cost;
};
template <typename T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
bool chmin(T& a, const T& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N, M;
  cin >> N >> M;
  vector<pair<ll, ll> > p(N);
  for (int i = 0; i < N; i++) {
    cin >> p[i].first >> p[i].second;
  }
  vector<pair<ll, ll> > g(M);
  for (int i = 0; i < M; i++) {
    cin >> g[i].first >> g[i].second;
  }
  for (int i = 0; i < N; i++) {
    ll ans = 1e7, place = -1;
    for (int j = 0; j < M; j++) {
      if (chmin(ans,
                abs(p[i].first - g[j].first) + abs(p[i].second - g[j].second)))
        place = j + 1;
    }
    cout << place << endl;
  }
}
