#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  pair<int, int> A[N], B[M];
  for (int i = 0; i < N; i++) {
    cin >> A[i].first >> A[i].second;
  }
  for (int i = 0; i < M; i++) {
    cin >> B[i].first >> B[i].second;
  }
  int x;
  for (int i = 0; i < N; i++) {
    int min_diff = 10000000;
    for (int j = 0; j < M; j++) {
      int diff[M];
      diff[j] = abs(A[i].first - B[j].first) + abs(A[i].second - B[j].second);
      if (min_diff > diff[j]) {
        min_diff = diff[j];
        x = j;
      }
    }
    cout << x + 1 << endl;
  }
}
