#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y;
};
node a[60];
node b[60];
int c[60];
int d[60];
int main() {
  int n, m;
  memset(c, 1e9 + 10, sizeof(c));
  memset(d, 1e9 + 10, sizeof(d));
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d %d", &a[i].x, &a[i].y);
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &b[i].x, &b[i].y);
    for (int j = 1; j <= n; j++) {
      if ((abs(b[i].x - a[j].x) + abs(b[i].y - a[j].y)) < c[j]) {
        c[j] = abs(b[i].x - a[j].x) + abs(b[i].y - a[j].y);
        d[j] = i;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << d[i] << endl;
  }
  return 0;
}
