#include <bits/stdc++.h>
using namespace std;
int abs(int n) {
  if (n < 0)
    return -n;
  else
    return n;
}
int main() {
  int N, M;
  cin >> N >> M;
  int a[N], b[N], c[M], d[M];
  for (int i = 0; i < N; i++) {
    cin >> a[i] >> b[i];
  }
  for (int j = 0; j < M; j++) {
    cin >> c[j] >> d[j];
  }
  for (int i = 0; i < N; i++) {
    int minplace = 1;
    int dis = abs(a[0] - c[0]) + abs(b[0] - d[0]);
    for (int j = 0; j < M; j++) {
      if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < dis) {
        dis = abs(a[i] - c[j]) + abs(b[i] - d[j]);
        minplace = j + 1;
      }
    }
    cout << minplace << endl;
  }
}
