#include <bits/stdc++.h>
using namespace std;
int N, M;
int a[101], b[101], c[101], d[101];
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 0; i < N; ++i) scanf("%d%d", a + i, b + i);
  for (int i = 0; i < M; ++i) scanf("%d%d", c + i, d + i);
  for (int i = 0; i < N; ++i) {
    int maxv = 101010101;
    int ans = 0;
    for (int j = 0; j < M; ++j) {
      int dist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (dist < maxv) {
        maxv = dist;
        ans = j;
      }
    }
    printf("%d\n", ans + 1);
  }
  return 0;
}
