#include <bits/stdc++.h>
using namespace std;
struct Fast {
  Fast() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} fast;
long long mod = 1000000007;
long long div(long long a, long long b, long long c) {
  return b / c - (a - 1) / c;
}
void print_binary(long long a) {
  for (int i = 31; i >= 0; i--) {
    cout << (a >> i & 1);
  }
  cout << endl;
}
long long modpow(long long m, long long n) {
  if (n == 0) return 1;
  if (n % 2 == 0) {
    long long t = modpow(m, n / 2);
    return t * t;
  } else {
    return modpow(m, n - 1) * m;
  }
}
void yes() {
  cout << "Yes" << endl;
  exit(0);
}
void no() {
  cout << "No" << endl;
  exit(0);
}
int main() {
  long long n, m;
  cin >> n >> m;
  vector<int> as(n);
  vector<int> bs(n);
  vector<int> cs(n);
  vector<int> ds(n);
  for (int i = 0; i < n; i++) {
    cin >> as[i];
    cin >> bs[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> cs[i];
    cin >> ds[i];
  }
  for (int i = 0; i < n; i++) {
    vector<int> xs;
    long md = 1e10;
    for (int j = 0; j < m; j++) {
      if (md > abs(as[i] - cs[j]) + abs(bs[i] - ds[j])) {
        md = abs(as[i] - cs[j]) + abs(bs[i] - ds[j]);
      }
    }
    for (int j = 0; j < m; j++) {
      if (md == abs(as[i] - cs[j]) + abs(bs[i] - ds[j])) {
        xs.push_back(j);
      }
    }
    sort(xs.begin(), xs.end());
    cout << xs[0] + 1 << endl;
  }
}
