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