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