#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  int stu_x[n];
  int stu_y[n];
  int check_x[m];
  int check_y[m];
  for (int i = 0; i < n; i++) {
    cin >> stu_x[i] >> stu_y[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> check_x[i] >> check_y[i];
  }
  int min = inf;
  int ans;
  for (int i = 0; i < n; i++) {
    ans = 0;
    for (int j = 0; j < m; j++) {
      int dis_x = abs(stu_x[i] - check_x[j]);
      int dis_y = abs(stu_y[i] - check_y[j]);
      int DIS = dis_x + dis_y;
      if (DIS < min) {
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
