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