#include <bits/stdc++.h>
using namespace std;
int getDistance(int* student, int* check) {
  int x, y;
  return abs(student[0] - check[0]) + abs(student[1] - check[1]);
}
int getPos(int* student, int check[][2], int n, int m) {
  int min, pos, ii, ret;
  min = INT_MAX;
  for (ii = 0; ii < m; ii++) {
    ret = getDistance(student, check[ii]);
    if (ret < min) {
      min = ret;
      pos = ii;
    }
  }
  return pos + 1;
}
int main() {
  int n, m, ii;
  cin >> n >> m;
  int student[n][2];
  int check[m][2];
  int pos[n];
  for (ii = 0; ii < n; ii++) {
    cin >> student[ii][0];
    cin >> student[ii][1];
  }
  for (ii = 0; ii < m; ii++) {
    cin >> check[ii][0];
    cin >> check[ii][1];
  }
  for (ii = 0; ii < n; ii++) {
    pos[ii] = getPos(student[ii], check, m, n);
    cout << pos[ii] << endl;
  }
  return 0;
}
