#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  long long int n, m;
  std::cin >> n >> m;
  vector<vector<long long int> > d = vector<vector<long long int> >(
                                     n, vector<long long int>(2, 0)),
                                 c = vector<vector<long long int> >(
                                     n, vector<long long int>(2, 0));
  for (long long int i = 0; i < n; i++) std::cin >> d[i][0] >> d[i][1];
  for (long long int i = 0; i < m; i++) std::cin >> c[i][0] >> c[i][1];
  for (long long int i = 0; i < n; i++) {
    long long int dis = 10000000000, idx = -1;
    for (long long int j = 0; j < m; j++) {
      if (dis >= abs(d[i][0] - c[j][0]) + abs(d[i][1] - c[j][1]))
        dis = abs(d[i][0] - c[j][0]) + abs(d[i][1] - c[j][1]), idx = j;
    }
    std::cout << idx + 1 << '\n';
  }
}
