#include <bits/stdc++.h>
using namespace std;
long int a[100], b[100], c[100], d[100], result[100];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N;
  cin >> M;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    cin >> b[i];
  }
  for (int i = 0; i < M; i++) {
    cin >> c[i];
    cin >> d[i];
  }
  for (int i = 0; i < N; i++) {
    long int min = 100000000;
    for (int j = 0; j < M; j++) {
      long int dist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (min > dist) {
        min = dist;
        result[i] = j + 1;
        cout << j << endl;
      }
    }
  }
  for (int i = 0; i < N; i++) {
    cout << result[i] << "\n";
  }
}
