#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  int student[N][2], check[M][2];
  for (int i = 0; i < N; i++) cin >> student[i][0] >> student[i][1];
  for (int i = 0; i < M; i++) cin >> check[i][0] >> check[i][1];
  int distance[N][M];
  for (int i = 0; i < N; i++)
    for (int j = 0; j < M; j++)
      distance[i][j] =
          abs(student[i][0] - check[i][0]) + abs(student[i][1] - check[i][1]);
  for (int i = 0; i < N; i++) {
    int minD = distance[i][0];
    int res = 1;
    int j = 1;
    for (; j < M; j++)
      if (distance[i][j] < minD) {
        minD = distance[i][j];
        res = j + 1;
      }
    cout << res << endl;
  }
  return 0;
}
