#include <bits/stdc++.h>
using namespace std;
long long ss = 1e9 + 7;
int main() {
  int N, M;
  cin >> N >> M;
  vector<long long> a(N + 1), b(N + 1), c(M + 1), d(M + 1);
  for (int i = 1; i <= N; i++) cin >> a[i] >> b[i];
  for (int i = 1; i <= M; i++) cin >> c[i] >> d[i];
  vector<pair<long long, int> > m[50];
  long long r;
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= M; j++) {
      r = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      m[i].push_back(make_pair(r, j));
    }
    sort(m[i].begin(), m[i].end());
    cout << m[i].front().second << endl;
  }
}
