#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
using V = vector<T>;
const int INF = 1e9;
const long long MOD = 1000000007;
const long long MAX = 510000;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}
long long COM(int n, int k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
vector<int> Eratosthenes(const int N) {
  vector<bool> is_prime(N + 1, true);
  vector<int> P;
  for (int i = 2; i <= N; i++) {
    if (is_prime[i]) {
      for (int j = 2 * i; j <= N; j += i) {
        is_prime[j] = false;
      }
      P.emplace_back(i);
    }
  }
  return P;
}
int main() {
  int n, m;
  cin >> n;
  cin >> m;
  vector<int> A(n);
  vector<int> B(n);
  for (int i = 0; i < n; ++i) {
    cin >> A[i] >> B[i];
  }
  vector<int> C(m);
  vector<int> D(m);
  for (int i = 0; i < m; ++i) {
    cin >> C[i] >> D[i];
  }
  vector<int> total(n);
  for (int i = 0; i < n; ++i) {
    int mn = 10000;
    int num = 0;
    int t = 0;
    for (int j = 0; j < m; ++j) {
      t = abs(A[i] - C[j]) + abs(B[i] - D[j]);
      if (t < mn) {
        mn = t;
        num = j + 1;
      }
    }
    total[i] = num;
  }
  for (int i = 0; i < n; ++i) {
    cout << total[i] << "\n";
  }
}
