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