#include <bits/stdc++.h>
using namespace std;
int culc(int ax, int ay, int bx, int by) {
  int dx, dy;
  dx = abs(ax - bx);
  dy = abs(ay - by);
  return dx + dy;
}
int main() {
  int N, M;
  int no;
  int dist;
  int min;
  int a[60], b[60];
  int c[60], d[60];
  cin >> N >> M;
  for (int i = 1; i <= N; i++) cin >> a[i] >> b[i];
  for (int i = 1; i <= M; i++) cin >> c[i] >> d[i];
  for (int i = 1; i <= N; i++) {
    min = 200000011;
    for (int j = 1; j <= M; j++) {
      dist = culc(a[i], b[i], c[j], d[j]);
      if (dist < min) {
        min = dist;
        no = j;
      }
    }
    cout << no << endl;
  }
}
