#include <bits/stdc++.h>
using namespace std;
int man_distance(int x_1, int y_1, int x_2, int y_2);
int main() {
  int n, m;
  vector<int> a, b;
  vector<int> c, d;
  int temp1, temp2;
  vector<int> next_point;
  int min_dis = pow(10, 8);
  int now_dis = -1;
  int min_p;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> temp1 >> temp2;
    a.push_back(temp1);
    b.push_back(temp2);
  }
  for (int i = 0; i < m; i++) {
    cin >> temp1 >> temp2;
    c.push_back(temp1);
    d.push_back(temp2);
  }
  for (int i = 0; i < n; i++) {
    for (int now_p = 0; now_p < m; now_p++) {
      now_dis = man_distance(a[i], b[i], c[now_p], d[now_p]);
      if (min_dis > now_dis) {
        min_dis = now_dis;
        min_p = now_p + 1;
      }
    }
    next_point.push_back(min_p);
    min_dis = pow(10, 8);
  }
  for (int i = 0; i < n; i++) {
    cout << next_point[i] << endl;
  }
}
int man_distance(int x_1, int y_1, int x_2, int y_2) {
  return (abs(x_1 - x_2) + abs(y_1 - y_2));
}
