#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vb = vector<bool>;
using vvb = vector<vb>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
template <class T>
using V = vector<T>;
template <class T>
using VV = vector<V<T>>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const double PI = acos(-1), EPS = 1e-10;
const ll MOD = 1e9 + 7;
int dis(int a, int b, int c, int d) { return abs(a - c) + abs(b - d); }
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int m, n;
  cin >> n >> m;
  vi a(n), b(n), c(m), d(m);
  for (ll i = (0); i < (ll)(n); ++i) cin >> a[i] >> b[i];
  for (ll i = (0); i < (ll)(m); ++i) cin >> c[i] >> d[i];
  for (ll i = (0); i < (ll)(n); ++i) {
    int ans = 0, md = INT_MAX;
    for (ll j = (0); j < (ll)(m); ++j) {
      if (md > dis(a[i], b[i], c[j], d[j])) {
        ans = j;
        md = dis(a[i], b[i], c[j], d[j]);
      }
    }
    cout << ans << endl;
  }
}
