#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using pii = pair<i64, i64>;
template <class A, class B>
inline bool chmax(A &a, const B &b) {
  return b > a ? a = b, 1 : 0;
}
template <class A, class B>
inline bool chmin(A &a, const B &b) {
  return b < a ? a = b, 1 : 0;
}
constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod = int(1e9) + 7;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m;
  cin >> n >> m;
  vector<int> a(n + 1), b(n + 1);
  for (int i = 1; i <= n; ++i) cin >> a[i] >> b[i];
  vector<int> c(m + 1), d(n + 1);
  for (int i = 1; i <= m; ++i) cin >> c[i] >> d[i];
  for (int i = 1; i <= n; ++i) {
    vector<pii> res;
    for (int j = 1; j <= m; ++j) {
      int x = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      res.push_back(pii(x, j));
    }
    sort(res.begin(), res.end());
    cout << res[0].second << "\n";
  }
  return 0;
}
