#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  int i, j;
  int MD = 0;
  cin >> N >> M;
  int a[N], b[N], c[M], d[M], Pre[N];
  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 (i = 0; i < N; i++) {
    int Min = 100000000;
    int Minj = 100000000;
    for (j = 0; j < M; j++) {
      MD = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (Min > MD) {
        Min = MD;
        Minj = j;
      }
      if (Min == MD) {
        Minj = min(Minj, j);
      }
    }
    Pre[i] = Minj + 1;
  }
  for (int i = 0; i < N; i++) {
    cout << Pre[i] << endl;
  }
  return 0;
}
