#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  int a[100], b[100], c[100], d[100], dis[100], ans[100] = {};
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &a[i], &b[i]);
    dis[i] = 1 << 21;
  }
  for (int i = 0; i < m; i++) scanf("%d %d", &c[i], &d[i]);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      int di = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (di < dis[i]) {
        dis[i] = di;
        ans[i] = j + 1;
      }
    }
  }
  for (int i = 0; i < n; i++) printf("%d\n", ans[i]);
  return 0;
}
