#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<long long> a(N), b(N), c(M), d(M);
  for (int i = 0; i < (int)(N); i++) cin >> a[i] >> b[i];
  for (int i = 0; i < (int)(M); i++) cin >> c[i] >> d[i];
  vector<long long> dis(N), poi(N);
  for (int i = 0; i < (int)(N); i++) dis[i] = (1e9), poi[N] = (1e9);
  for (int i = 0; i < (int)(N); i++) {
    for (int j = 0; j < (int)(M); j++) {
      long long temp = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (dis[i] > temp) poi[i] = j + 1;
      dis[i] = min(dis[i], temp);
    }
  }
  for (int i = 0; i < (int)(N); i++) cout << poi[i] << endl;
  return 0;
}
