#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int maxn = 50 + 5;
int a[maxn], b[maxn];
int c[maxn], d[maxn];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d%d", &a[i], &b[i]);
  for (int j = 1; j <= m; j++) scanf("%d%d", &c[j], &d[j]);
  for (int i = 1; i <= n; i++) {
    int to, now, mn = INF;
    for (int j = 1; j <= n; j++) {
      now = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (now < mn) mn = now, to = j;
    }
    printf("%d\n", to);
  }
  return 0;
}
