#include <bits/stdc++.h>
int main() {
  const int INF = 99999999;
  const int MAX_N = 50;
  const int MAX_M = 50;
  int n, m;
  int a[MAX_N];
  int b[MAX_N];
  int c[MAX_M];
  int d[MAX_M];
  std::cin >> n >> m;
  for (int i = 0; i < n; i++) std::cin >> a[i] >> b[i];
  for (int i = 0; i < m; i++) std::cin >> c[i] >> d[i];
  for (int i = 0; i < n; i++) {
    int min = INF, point;
    for (int j = 0; j < m; j++) {
      int distance = std::abs(a[i] - c[j]) + std::abs(b[i] - d[j]);
      if (min > distance) {
        min = distance;
        point = j + 1;
      }
    }
    std::cout << point << std::endl;
  }
}
