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