#include <bits/stdc++.h>
using namespace std;
long long int dx[] = {1, -1, 0, 0};
long long int dy[] = {0, 0, 1, -1};
long long int n, m;
long long int a, b;
long long int p, q;
signed main() {
  (cin >> n >> m);
  vector<pair<long long int, long long int>> stu(n);
  vector<pair<long long int, long long int>> pnt(m);
  for (long long int i = (0); i < (n); ++i) {
    (cin >> stu[i].first >> stu[i].second);
  }
  for (long long int i = (0); i < (m); ++i) {
    (cin >> pnt[i].first >> pnt[i].second);
  }
  for (long long int i = (0); i < (n); ++i) {
    long long int m =
        abs(stu[i].first - pnt[0].first) + abs(stu[i].second - pnt[0].second);
    long long int mj = 0;
    for (long long int j = (0); j < (m); ++j) {
      if (m > abs(stu[i].first - pnt[j].first) +
                  abs(stu[i].second - pnt[j].second)) {
        m = abs(stu[i].first - pnt[j].first) +
            abs(stu[i].second - pnt[j].second);
        mj = j;
      }
    }
    (cout << mj + 1 << endl);
  }
  return 0;
}
