#include <bits/stdc++.h>
using namespace std;
long long a[55], b[55], c[55], d[55];
int vis[55];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%lld %lld", &a[i], &b[i]);
  }
  for (int i = 1; i <= m; i++) {
    scanf("%lld %lld", &c[i], &d[i]);
  }
  long long p;
  for (int i = 1; i <= n; i++) {
    long long temp = 100000001;
    for (int j = 1; j <= m; j++) {
      p = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (p < temp) {
        temp = min(p, temp);
        vis[i] = j;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    printf("%d\n", vis[i]);
  }
}
