#include <bits/stdc++.h>
using namespace std;
template <class t, class u>
void chmax(t& a, u b) {
  if (a < b) a = b;
}
template <class t, class u>
void chmin(t& a, u b) {
  if (b < a) a = b;
}
template <class t>
using vc = vector<t>;
template <class t>
using vvc = vc<vc<t>>;
using pi = pair<int, int>;
using vi = vc<int>;
void yes() { cout << "Yes" << endl; }
void no() { cout << "No" << endl; }
int SIZE(string s) { return (int)s.size(); }
const long long INF = 1LL << 60;
int main() {
  cout << fixed << setprecision(20);
  int n, m;
  cin >> n >> m;
  vc<pi> a(n), b(n);
  for (int i = int(0); i < int(n); i++) cin >> a[i].first >> a[i].second;
  for (int i = int(0); i < int(m); i++) cin >> b[i].first >> b[i].second;
  for (int i = int(0); i < int(n); i++) {
    long long mi = INF;
    int ans = 0;
    for (int j = int(0); j < int(m); j++) {
      long long cur =
          abs(a[i].first - b[j].first) + abs(a[i].second - b[j].second);
      if (cur < mi) {
        mi = cur;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
