#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  pair<long long, long long> a[n], b[m];
  for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
  for (int i = 0; i < m; i++) cin >> b[i].first >> b[i].second;
  for (int i = 0; i < n; i++) {
    long long mnd = 1000000000000000000, ind;
    for (int j = 0; j < n; j++)
      if (abs(a[i].first - b[j].first) + abs(a[i].second - b[j].second) < mnd) {
        ind = j + 1;
        mnd = abs(a[i].first - b[j].first) + abs(a[i].second - b[j].second);
      }
    cout << ind << endl;
  }
  return 0;
}
