#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int num, points, ans;
  long long man = 1000000000;
  int stu_x[50], stu_y[50];
  long long poi_x[50], poi_y[50];
  bool low = false;
  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]);
        low = true;
        if (j == points - 1) ans = j;
      } else if (low) {
        ans = j;
        low = false;
      }
    }
    cout << ans << endl;
    man = 1000000000;
  }
  return 0;
}
