#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m, stux[50], stuy[50], chex[50], chey[50];
  int num, tmp, minl;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> stux[i] >> stuy[i];
  for (int i = 0; i < m; i++) cin >> chex[i] >> chey[i];
  for (int istu = 0; istu < n; istu++) {
    minl = 10000000;
    for (int iche = 0; iche < m; iche++) {
      tmp = abs(stux[istu] - chex[iche]) + abs(stuy[istu] - chey[iche]);
      if (tmp < minl) {
        minl = tmp;
        num = iche + 1;
      }
    }
    cout << num << "\n";
  }
  return 0;
}
