#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T gcd(T a, T b) {
  while (b != 0) swap(b, a %= b);
  return a;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<long long, long long> > a(n), b(m);
  for (int i = 0; i < n; ++i) cin >> a[i].first >> a[i].second;
  for (int i = 0; i < m; ++i) cin >> b[i].first >> b[i].second;
  vector<bool> vis(m, false);
  for (long long i = 0; i < n; ++i) {
    pair<long long, long long> ans = {INT_MAX, INT_MAX};
    for (long long j = 0; j < m; ++j) {
      if (!vis[j]) {
        ans = min(
            ans,
            {abs(a[i].first - b[j].first) + abs(a[i].second - b[j].second), j});
      }
    }
    cout << ans.second + 1 << '\n';
    vis[ans.second] = true;
  }
}
