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