#include <bits/stdc++.h>
using namespace std;
struct node {
  int fi;
  int x;
  int y;
  int d;
};
node a[50];
node b[50];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i].x >> a[i].y;
    a[i].d = 0x3f3f3f;
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i].x >> b[i].y;
    for (int j = 0; j < n; j++) {
      if (abs(a[j].x - b[i].x) + abs(a[j].y - b[i].y) < a[j].d) {
        a[j].d = abs(a[j].x - b[i].x) + abs(a[j].y - b[i].y);
        a[j].fi = i + 1;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    cout << a[i].fi << endl;
  }
  return 0;
}
