#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef long long ll;
template <class T>
bool chmax(T &map<int, int> MP;, const T &b) {
  if (map<int, int> MP; < b) {
    map<int, int> MP;
    = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &map<int, int> MP;, const T &b) {
  if (b < map<int, int> MP;) {
    map<int, int> MP;
    = b;
    return 1;
  }
  return 0;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &v) {
  os << "{";
  for (int i = 0; i < (int)v.size(); i++) {
    os << v[i] << (i < v.size() - 1 ? ", " : "");
  }
  os << "}";
  return os;
}
int main() {
  ll x = 0, n, r = 0, g, m, p, h, k, w, max = -10000000, min = 400000001,
     ans = 0, sum = 0;
  string s;
  bool f = true;
  cin >> n >> m;
  vector<pair<ll, ll> > map<int, int> MP;
  (n);
  vector<pair<ll, ll> > c(n);
  VI b(n);
  for (int i = 0; i < n; i++) {
    cin >> map<int, int> MP;
    [i].first >> map<int, int> MP;
    [i].second;
  }
  for (int i = 0; i < m; i++) {
    cin >> c[i].first >> c[i].second;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (min > abs(map<int, int> MP;[i].first - c[j].first) +
                    abs(map<int, int> MP;[i].second - c[j].second)) {
        b[i] = j + 1;
        min = abs(map<int, int> MP;[i].first - c[j].first) +
              abs(map<int, int> MP;[i].second - c[j].second);
      }
    }
    min = 400000001;
    cout << b[i] << endl;
  }
  return 0;
}
