#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
ll modpow(ll i, ll j) {
  ll tmp = 1;
  while (j) {
    if (j % 2) tmp = ((tmp * i) % (ll)(1e9 + 7));
    i = ((i * i) % (ll)(1e9 + 7));
    j /= 2;
  }
  return tmp;
}
template <typename T>
pair<vector<T>, int> getAuto() {
  int N;
  cin >> N;
  pair<vector<T>, int> rt;
  rt.first.resize(N);
  rt.second = N;
  for (size_t i = 0; i < (N); i++) cin >> rt.first[i];
  return rt;
}
void removeAt(string& s, int index) { s.erase(index, 1); }
template <typename T>
void removeAt(vector<T>& v, int index) {
  v.erase(v.begin() + index);
}
ll manhattanDistance(ll x1, ll y1, ll x2, ll y2) {
  return (abs(x2 - x1) + abs(y2 - y1));
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<ll> a, b, c, d;
  a.resize(N);
  b.resize(N);
  c.resize(M);
  d.resize(M);
  for (size_t i = 0; i < (N); i++) {
    cin >> a[i] >> b[i];
  }
  for (size_t i = 0; i < (M); i++) {
    cin >> c[i] >> d[i];
  }
  for (size_t n = 0; n < (N); n++) {
    int _min = INT_MAX / 2;
    int index = 0;
    for (size_t m = 0; m < (M); m++) {
      int distance = manhattanDistance(a[n], b[n], c[m], d[m]);
      if (_min > distance) {
        index = m;
        _min = distance;
      }
    }
    cout << (index + 1) << endl;
    ;
  }
}
