#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int num, points;
  long long man = 1000000000;
  int stu_x[50], stu_y[50];
  long long poi_x[50], poi_y[50];
  cin >> num >> points;
  for (int i = 0; i < num; i++) {
    cin >> stu_x[i] >> stu_y[i];
  }
  for (int i = 0; i < points; i++) {
    cin >> poi_x[i] >> poi_y[i];
  }
  for (int i = 0; i < num; i++) {
    for (int j = 0; j < points; j++) {
      if (man > abs(stu_x[i] - poi_x[j]) + abs(stu_y[i] - poi_y[j])) {
        man = abs(stu_x[i] - poi_x[j]) + abs(stu_y[i] - poi_y[j]);
      } else {
        cout << j << endl;
        man = 1000000000;
        break;
      }
      if (j == points - 1) {
        cout << j << endl;
        man = 1000000000;
      }
    }
  }
  return 0;
}
