#include <bits/stdc++.h>
using namespace std;
const int dx[8] = {1, 0, -1, 0, -1, 1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, -1, -1, 1};
int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int>> student(N);
  vector<pair<int, int>> check(M);
  vector<int> ans(N);
  int tmp, tmp1;
  for (int i = 0; i < N; i++) {
    cin >> tmp >> tmp1;
    student[i] = make_pair(tmp, tmp1);
  }
  for (int i = 0; i < M; i++) {
    cin >> tmp >> tmp1;
    check[i] = make_pair(tmp, tmp1);
  }
  int minsum = 1 << 20;
  int miniindex = 0;
  for (int i = 0; i < N; i++) {
    minsum = 1 << 20;
    for (int j = 0; j < M; j++) {
      int diff = abs(student[i].first - check[j].first) +
                 abs(student[i].second - check[j].second);
      if (minsum > diff) {
        minsum = diff;
        miniindex = j;
      }
    }
    cout << miniindex + 1 << '\n';
  }
}
