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