#include <bits/stdc++.h>
using namespace std;
int mht(int ax, int ay, int bx, int by) { return abs(ax - bx) + abs(ay - by); }
int main() {
  int N, M;
  int a[55], b[55], c[55], d[55];
  cin >> N >> M;
  for (int i = 0; i < N; i++) cin >> a[i] >> b[i];
  for (int j = 0; j < M; j++) cin >> c[j] >> d[j];
  bool is_occupied_chpt[55] = {0};
  int tmp_nearest_chpt, ans[55];
  for (int i = 0; i < N; i++) {
    tmp_nearest_chpt = 0;
    for (int j = 1; j < M; j++) {
      if (is_occupied_chpt[j] == true) continue;
      if (mht(a[i], b[i], c[j], d[j]) <
          mht(a[i], b[i], c[tmp_nearest_chpt], d[tmp_nearest_chpt]))
        tmp_nearest_chpt = j;
    }
    is_occupied_chpt[tmp_nearest_chpt] = true;
    ans[i] = tmp_nearest_chpt;
  }
  for (int i = 0; i < N; i++) cout << ans[i] + 1 << endl;
  return 0;
}
