#include <bits/stdc++.h>
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
using ll = long long;
using namespace std;
constexpr long long MAX = 5100000;
constexpr long long INF = 1LL << 60;
constexpr int MOD = 1000000007;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<int> a(n), b(n), c(m), d(m);
  for (int i = 0; i < (n); i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 0; i < (m); i++) {
    cin >> c[i] >> d[i];
  }
  vector<int> move;
  for (int i = 0; i < (n); i++) {
    ll dist = MAX;
    int idx;
    for (int j = 0; j < (m); j++) {
      ll tmp_dist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (chmin(dist, tmp_dist)) {
        idx = j;
      }
    }
    move.push_back(idx + 1);
  }
  for (auto v : move) {
    cout << v << endl;
  }
  return 0;
}
