#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vll = vector<long long>;
using vp = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvll = vector<vector<long long>>;
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T &a, T b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const int INF = 1001001001;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vi a(n), b(n);
  for (int i = 0; i < (int)(n); i++) cin >> a[i] >> b[i];
  vi c(m), d(m);
  for (int i = 0; i < (int)(m); i++) cin >> c[i] >> d[i];
  vi ans(n);
  for (int i = 0; i < (int)(n); i++) {
    int idx = 0;
    double mn = INF;
    for (int j = 0; j < (int)(m); j++) {
      if (chmin(mn, hypot(a[i] - c[j], b[i] - d[j]))) idx = j + 1;
    }
    ans[i] = idx;
  }
  for (int i = 0; i < (int)(n); i++) cout << ans[i] << endl;
}
