#include <bits/stdc++.h>
using namespace std;
template <typename T>
vector<vector<T>> make_2d_vector(size_t rows, size_t cols, T init) {
  return vector<vector<T>>(rows, vector<T>(cols, init));
}
const int inf = 1e+8;
vector<int> a(50), b(50), c(50), d(50);
int dist(int i, int j) { return abs(a[i] - c[j]) + abs(b[i] - d[j]); }
int main() {
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> 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];
  }
  for (int i = 0; i < N; i++) {
    int nj;
    int nd = inf;
    for (int j = M - 1; j >= 0; j--) {
      int d = dist(i, j);
      if (d <= nd) {
        nj = j;
        nd = d;
      }
    }
    cout << nj + 1 << "\n";
  }
  return 0;
}
