#include <bits/stdc++.h>
using namespace std;
long long abs(long long a, long long b) {
  if (a > b) {
    return a - b;
  } else {
    return b - a;
  }
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<long long, long long>> X(N);
  for (int i = 0; i < N; i++) {
    cin >> X[i].first >> X[i].second;
  }
  vector<pair<long long, long long>> Y(M);
  for (int j = 0; j < M; j++) {
    cin >> Y[j].first >> Y[j].second;
  }
  for (int i = 0; i < N; i++) {
    long long ans = 1;
    long long min_distance = 1e9;
    for (int j = 0; j < M; j++) {
      long long s = abs(X[i].first, Y[j].first) + abs(X[i].second, Y[j].second);
      if (s < min_distance) {
        ans = j + 1;
      } else {
        continue;
      };
    }
    cout << ans << endl;
  }
  return 0;
}
