#include <bits/stdc++.h>
using namespace std;
signed main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long int N, M;
  cin >> N >> M;
  long long int a[N], b[N];
  for (long long int i = 0; i < N; i++) cin >> a[i] >> b[i];
  long long int c[N], d[N];
  for (long long int i = 0; i < M; i++) cin >> c[i] >> d[i];
  for (long long int i = 0; i < N; i++) {
    long long int minimum = 1000000000000000000;
    long long int min_ID = 0;
    for (long long int j = 0; j < M; j++) {
      long long int distance = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (minimum > distance) {
        minimum = distance;
        min_ID = j;
      }
    }
    cout << min_ID + 1 << endl;
  }
  return 0;
}
