#include <bits/stdc++.h>
int main() {
  int s_x[51], s_y[51], m_x[51], m_y[51], cur_dis;
  int n, m, checkpoint;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%d%d", &s_x[i], &s_y[i]);
  for (int i = 0; i < m; i++) scanf("%d%d", &m_x[i], &m_y[i]);
  for (int i = 0; i < n; i++) {
    int update_dis = 10000010;
    for (int j = 0; j < m; j++) {
      cur_dis = abs(s_x[i] - m_x[j]) + abs(s_y[i] - m_y[j]);
      if (update_dis > cur_dis) {
        update_dis = cur_dis;
        checkpoint = j + 1;
      }
    }
    printf("%d\n", checkpoint);
  }
  return 0;
}
