#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<long long int> a(N, 0);
  vector<long long int> b(N, 0);
  for (int i = 0; i < (N); i++) cin >> a[i] >> b[i];
  vector<long long int> c(N, 0);
  vector<long long int> d(N, 0);
  for (int i = 0; i < (M); i++) cin >> c[i] >> d[i];
  for (int i = 0; i < (M); i++) cerr << d[i] << endl;
  for (int i = 0; i < (N); i++) {
    int check = 1;
    long long int max = INT_MAX;
    for (int j = 0; j < (M); j++) {
      long long int e = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (max > e) {
        max = e;
        check = j + 1;
      }
    }
    cout << check << endl;
  }
}
