#include <bits/stdc++.h>
using namespace std;
template <class C>
inline bool in_(const typename C::key_type& k, const C& A) {
  return A.find(k) != A.end();
}
inline bool in_(const string& s, const string& S) {
  return S.find(s) != string::npos;
}
int main() {
  std::ios::sync_with_stdio(false);
  int n, m;
  while (cin >> n >> m) {
    int a[n], b[n], c[m], d[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];
    int cnt = 1e5, ans;
    for (int i = (0); i < (n); ++i) {
      cnt = 1e5;
      for (int j = (0); j < (m); ++j) {
        int length = abs(a[i] - c[j]) + abs(b[i] - d[j]);
        if (cnt > length) {
          cnt = length;
          ans = j + 1;
        }
      }
      cout << ans << endl;
    }
  }
}
