#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t n, m;
  cin >> n >> m;
  vector<pair<int64_t, int64_t>> a(n);
  vector<pair<int64_t, int64_t>> b(m);
  int64_t i;
  for (i = 0; i < n; i++) {
    int64_t c, d;
    cin >> c >> d;
    a.at(i) = make_pair(c, d);
  }
  for (i = 0; i < m; i++) {
    int64_t c, d;
    cin >> c >> d;
    b.at(i) = make_pair(c, d);
  }
  int64_t j;
  for (i = 0; i < n; i++) {
    int64_t sum = abs(a.at(0).first - b.at(0).first) +
                  abs(a.at(0).second - b.at(0).second);
    pair<int64_t, int64_t> mini;
    mini.second = 1;
    for (j = 0; j < m; j++) {
      mini.first = abs(a.at(i).first - b.at(j).first) +
                   abs(a.at(i).second - b.at(j).second);
      if (mini.first < sum) {
        sum = mini.first;
        mini.second = j + 1;
      }
    }
    cout << mini.second << endl;
  }
}
