#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
inline bool chmax(A &a, B b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename A, typename B>
inline bool chmin(A &a, B b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long INF = 1ll << 30;
const long long MOD = 1000000007;
const double EPS = 1e-10;
int main() {
  int n, m;
  vector<int> a(n);
  vector<int> b(n);
  vector<int> c(m);
  vector<int> d(m);
  cin >> n >> m;
  for (int i = (0); i < (n); i++) cin >> a[i] >> b[i];
  for (int i = (0); i < (m); i++) cin >> c[i] >> d[i];
  vector<int> ans(n, 1);
  for (int i = (0); i < (n); i++) {
    int mn = abs(a[i] - c[0]) + abs(b[i] - d[0]);
    for (int j = (0); j < (m); j++) {
      if (mn > abs(a[i] - c[j]) + abs(b[i] - d[j])) {
        mn = abs(a[i] - c[j]) + abs(b[i] - d[j]);
        ans[i] = j + 1;
      }
    }
  }
  for (int i = (0); i < (n); i++) cout << ans[i] << endl;
}
