#include <bits/stdc++.h>
using namespace std;
const long long MAX_n = 50;
long long n, a[MAX_n], b[MAX_n];
const long long MAX_m = 50;
long long m, c[MAX_m], d[MAX_m];
long long ans;
signed main() {
  scanf("%d", &n);
  scanf("%d", &m);
  for (long long i = 0; i < n; i++) {
    scanf("%d%d", &a[i], &b[i]);
  }
  for (long long i = 0; i < m; i++) {
    scanf("%d%d", &c[i], &d[i]);
  }
  for (long long i = 0; i < n; i++) {
    long long dis = 100000000;
    for (long long j = 0; j < m; j++) {
      long long temp;
      temp = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (dis > temp) {
        dis = temp;
        ans = j + 1;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
