#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
void solve(int N, int M, vector<long> a, vector<long> b, vector<long> c,
           vector<long> d) {
  for (int i = 0; i < (N); ++i) {
    long min_dist = 2 * 1E8;
    int nearest_cp = 0;
    for (int j = 0; j < (M); ++j) {
      long dist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (dist < min_dist) {
        min_dist = dist;
        nearest_cp = j + 1;
      }
    }
    cout << nearest_cp << endl;
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  vector<long> a(N), b(N);
  for (int i = 0; i < (N); ++i) cin >> a[i] >> b[i];
  vector<long> c(M), d(M);
  for (int i = 0; i < (M); ++i) cin >> c[i] >> d[i];
  solve(N, M, move(a), move(b), move(c), move(d));
  return 0;
}
