#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
ll lcm(ll a, ll b) {
  ll g = gcd(a, b);
  return a / g * b;
}
ll mulMod(ll a, ll b) { return (((a % MOD) * (b % MOD)) % MOD); }
void solve(long long N, long long M, std::vector<long long> a,
           std::vector<long long> b, std::vector<long long> c,
           std::vector<long long> d) {
  for (size_t i = 0; i < N; i++) {
    ll checkpoint;
    ll dist = INT16_MAX;
    for (size_t j = 0; j < M; j++) {
      if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < dist) {
        dist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
        checkpoint = j;
      }
    }
    cout << checkpoint + 1 << endl;
  }
}
int main() {
  long long N;
  scanf("%lld", &N);
  long long M;
  scanf("%lld", &M);
  std::vector<long long> a(N);
  std::vector<long long> b(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &a[i]);
    scanf("%lld", &b[i]);
  }
  std::vector<long long> c(M);
  std::vector<long long> d(M);
  for (int i = 0; i < M; i++) {
    scanf("%lld", &c[i]);
    scanf("%lld", &d[i]);
  }
  solve(N, M, std::move(a), std::move(b), std::move(c), std::move(d));
  return 0;
}
