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