#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N, M;
  cin >> N >> M;
  vector<vector<int>> S(N, vector<int>(2, 0));
  vector<vector<int>> T(M, vector<int>(2, 0));
  for (int i = 0; i < N; i++) {
    cin >> S[i][0] >> S[i][1];
  }
  for (int i = 0; i < M; i++) {
    cin >> T[i][0] >> T[i][1];
  }
  for (int i = 0; i < N; i++) {
    int Dmin = abs(S[0][0] - T[0][0]) + abs(S[0][1] - T[0][1]), D;
    int index = 0;
    for (int j = 0; j < M; j++) {
      D = abs(S[i][0] - T[j][0]) + abs(S[i][1] - T[j][1]);
      if (Dmin > D) {
        Dmin = D;
        index = j;
      }
    }
    cout << index + 1 << endl;
  }
}
