#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<vector<int>> stu(N, vector<int>(2));
  vector<vector<int>> spa(M, vector<int>(2));
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < 2; ++j) {
      cin >> stu[i][j];
    }
  }
  for (int i = 0; i < M; ++i) {
    for (int j = 0; j < 2; ++j) {
      cin >> spa[i][j];
    }
  }
  vector<int> ans(N);
  for (int i = 0; i < N; ++i) {
    int Min = 100000000;
    for (int j = 0; j < M; ++j) {
      int dis = abs(stu[i][0] - spa[j][0]) + abs(stu[i][1] - spa[j][1]);
      if (Min > dis) {
        Min = dis;
        ans[i] = j + 1;
      }
    }
  }
  for (int i = 0; i < ans.size(); ++i) {
    cout << ans[i] << endl;
  }
  return 0;
}
