#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
const int MAX = 510000;
const double pi = acos(-1);
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  vector<long long> a(n), b(n), c(m), d(n);
  for (long long i = 0; i < (long long)(n); i++) cin >> a[i] >> b[i];
  for (long long i = 0; i < (long long)(m); i++) cin >> c[i] >> d[i];
  vector<long long> ans(n);
  for (long long i = 0; i < (long long)(n); i++) {
    long long dist = INF;
    for (long long j = m - 1; j >= 0; j--) {
      if (abs(a[i] - c[j]) + abs(b[i] - d[j]) <= dist) {
        dist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
        ans[i] = j + 1;
      }
    }
  }
  for (long long i = 0; i < (long long)(n); i++) cout << ans[i] << endl;
  return 0;
}
