#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int>> v(N);
  vector<pair<int, int>> w(M);
  for (int i = 0; i < N; ++i) {
    cin >> v[i].first >> v[i].second;
  }
  for (int i = 0; i < M; ++i) {
    cin >> w[i].first >> w[i].second;
  }
  int m, n, a;
  for (int i = 0; i < N; ++i) {
    m = 1000000000;
    n = -1;
    for (int j = 0; j < M; ++j) {
      a = abs(v[i].first - w[j].first) + abs(v[i].second - w[j].second);
      if (m > a) {
        m = a;
        n = j;
      }
    }
    cout << n << endl;
  }
  return 0;
}
