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