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