#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> a(n);
  vector<pair<int, int>> c(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
  }
  for (int i = 0; i < m; i++) {
    cin >> c[i].first >> c[i].second;
  }
  for (int i = 0; i < n; i++) {
    int best = 1e9;
    int besti = m;
    for (int j = 0; j < m; j++) {
      int cur = abs(c[j].first - a[i].first) + abs(c[j].second - a[i].second);
      if (cur < best) {
        best = cur;
        besti = j + 1;
      }
    }
    cout << besti << '\n';
  }
  return 0;
}
