#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  long long int students[50][2] = {};
  long long int checkpoints[50][2] = {};
  for (int i = 0; i < n; i++) {
    cin >> students[i][0] >> students[i][1];
  }
  for (int i = 0; i < m; i++) {
    cin >> checkpoints[i][0] >> checkpoints[i][1];
  }
  int nearest[50];
  for (int i = 0; i < n; i++) {
    long long int distance;
    long long int n_distance = 100000000;
    for (int k = 0; k < m; k++) {
      distance = abs(students[i][0] - checkpoints[k][0]) +
                 abs(students[i][1] - checkpoints[k][1]);
      if (distance < n_distance) {
        nearest[i] = k;
        n_distance = distance;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    cout << nearest[i] + 1 << endl;
  }
}
