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