#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M;
  vector<int> a(N), b(N), c(M), d(M);
  for (int i=0; i<N; i++)
    cin >> a.at(i) >> b.at(i);
  for (int i=0; i<M; i++)
    cin >> c.at(i) >> d.at(i);
  int minmht = -1, minp=0;
  for (int i=0; i<N; i++) {
    for (int j=0; j<M; j++) {
      if (minmht==-1 || minmht>abs(a.at(i)-c.at(j))+abc(b.at(i)-d.at(j))) {
        minp = j+1;
        minmht = abs(a.at(i)-c.at(j))+abc(b.at(i)-d.at(j));
      }
    }
    cout << minp << endl;
    minmht = -1;
    minp = 0;
  }
}