#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int hu[60][2] = {0}, po[60][2] = {0};
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 2; j++) cin >> hu[i][j];
  for (int i = 0; i < m; i++)
    for (int j = 0; j < 2; j++) cin >> po[i][j];
  for (int i = 0; i < n; i++) {
    int mi = 100000000;
    for (int j = 0; j < m; j++) {
      int t = abs(hu[i][0] - po[j][0]) + abs(hu[i][1] - po[j][1]);
      mi = min(mi, t);
    }
    for (int j = 0; j < m; j++) {
      int t = abs(hu[i][0] - po[j][0]) + abs(hu[i][1] - po[j][1]);
      if (mi == t) {
        cout << j + 1 << endl;
        break;
      }
    }
  }
}
