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