#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  scanf("%d%d", &n, &m);
  int ax[n + 5];
  int ay[n + 5];
  int bx[m + 5];
  int by[m + 5];
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &ax[i], &ay[i]);
  }
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &bx[i], &by[i]);
  }
  int dist[n + 5];
  for (int i = 0; i < n; i++) dist[i] = 123456789;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      int small = 0;
      small = abs(ax[i] - bx[j]) + abs(ay[i] - by[j]);
      if (small <= dist[i]) {
        dist[i] = small;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if ((abs(ax[i] - bx[j]) + abs(ay[i] - by[j])) == dist[i]) {
        printf("%d\n", j + 1);
        break;
      }
    }
  }
}
