#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, d, r, ans, key;
  vector<pair<int, int>> v(60), l(60);
  cin >> N >> M;
  for (int i = 0; i < N; i++) {
    cin >> v[i].first >> v[i].second;
  }
  for (int i = 0; i < M; i++) {
    cin >> l[i].first >> l[i].second;
  }
  for (int i = 0; i < N; i++) {
    key = 100000000;
    for (int j = 0; j < M; j++) {
      d = 0;
      r = 0;
      d = v[i].first - l[j].first;
      r = v[i].second - l[j].second;
      if (d < 0) {
        d *= -1;
      }
      if (r < 0) {
        r *= -1;
      }
      if (d + r < key) {
        key = d + r;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
