#include <bits/stdc++.h>
using namespace std;
template <typename T>
void V(T &n) {
  for (long long int i = 0; i < n.size(); i++) {
    cin >> n[i];
  }
}
template <typename T, typename U>
void V2(T &n, U &m) {
  for (long long int i = 0; i < n.size(); i++) {
    cin >> n[i] >> m[i];
  }
}
template <typename T, typename U, typename W>
void V3(T &n, U &m, W &p) {
  for (long long int i = 0; i < n.size(); i++) {
    cin >> n[i] >> m[i] >> p[i];
  }
}
template <typename T>
void VV(T &n, long long int size) {
  for (long long int i = 0; i < n.size(); i++) {
    for (long long int j = 0; j < size; j++) {
      cin >> n[i][j];
    }
  }
}
void Main() {
  long long int n, m;
  cin >> n >> m;
  vector<long long int> a(n), b(n), c(m), d(m);
  V2(a, b), V2(c, d);
  for (long long int i = 0; i < n; i++) {
    long long int flag = -1;
    long double ans;
    for (long long int j = 0; j < m; j++) {
      if (flag == -1) {
        ans = (a[i] - c[j]) * (a[i] - c[j]) + (b[i] - d[j]) * (b[i] - d[j]);
        flag++;
      } else {
        if (ans >
            (a[i] - c[j]) * (a[i] - c[j]) + (b[i] - d[j]) * (b[i] - d[j])) {
          flag = j;
          ans = (a[i] - c[j]) * (a[i] - c[j]) + (b[i] - d[j]) * (b[i] - d[j]);
        }
      }
    }
    cout << flag + 1 << endl;
  }
  return;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20);
  Main();
  return 0;
}
