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