#include <bits/stdc++.h>
using namespace std;
int manhattan(int x, int y, int tx, int ty) {
  return abs(x - tx) + abs(y - ty);
}
int main() {
  int n, m;
  cin >> n >> m;
  int x[n], y[n], tx[m], ty[m];
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  for (int i = 0; i < m; i++) cin >> tx[i] >> ty[i];
  for (int i = 0; i < n; i++) {
    int ans = 0;
    int best = manhattan(x[i], y[i], tx[0], ty[0]);
    for (int j = 0; j < m; j++) {
      if (best > manhattan(x[i], y[i], tx[j], ty[j])) {
        ans = j;
        best = manhattan(x[i], y[i], tx[j], ty[j]);
      }
    }
    cout << ans << endl;
  }
  return 0;
}
