#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> x(N), y(N);
  vector<vector<int>> NZ(N, vector<int>(N)), MZ(M, vector<int>(M));
  for (int i = 0; i < (int)(N); i++) cin >> NZ.at(i).at(0) >> NZ.at(i).at(1);
  for (int i = 0; i < (int)(M); i++) cin >> MZ.at(i).at(0) >> MZ.at(i).at(1);
  for (int i = 0; i < (int)(N); i++) {
    x.at(i) = abs(NZ.at(i).at(0) - MZ.at(0).at(0)) +
              abs(NZ.at(i).at(1) - MZ.at(0).at(1));
    y.at(i) = 1;
    for (int j = 0; j < (int)(M); j++) {
      if (abs(NZ.at(i).at(0) - MZ.at(j).at(0)) +
              abs(NZ.at(i).at(1) - MZ.at(j).at(1)) <
          x.at(i)) {
        x.at(i) = abs(NZ.at(i).at(0) - MZ.at(j).at(0)) +
                  abs(NZ.at(i).at(1) - MZ.at(j).at(1));
        y.at(i) = j + 1;
      }
    }
  }
  for (int i = 0; i < (int)(N); i++) cout << y.at(i) << endl;
}
