#include <bits/stdc++.h>
using namespace std;
const int mod = 1E9 + 7;
const double eps = 1e-6;
int N, M;
struct Node {
  long long x, y;
} stu[55], che[55];
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= N; i++) {
    scanf("%d%d", &stu[i].x, &stu[i].y);
  }
  for (int i = 1; i <= M; i++) {
    scanf("%d%d", &che[i].x, &che[i].y);
  }
  for (int i = 1; i <= N; i++) {
    long long dis = 0x3f3f3f3f;
    int index;
    for (int j = 1; j <= M; j++) {
      if (abs(stu[i].x - che[j].x) + abs(stu[i].y - che[j].y) < dis) {
        dis = abs(stu[i].x - che[j].x) + abs(stu[i].y - che[j].y);
        index = j;
      }
    }
    printf("%d\n", index);
  }
}
