#include <bits/stdc++.h>
using namespace std;
int abs(int);
int manh(int, int, int, int);
int main() {
  int n, m;
  cin >> n >> m;
  int a[n];
  int b[n];
  int c[m], d[m];
  for (int i = 0; i < n; ++i) {
    cin >> a[i] >> b[i];
  }
  for (int i = 0; i < m; ++i) {
    cin >> c[i] >> d[i];
  }
  int current_dist;
  for (int i = 0; i < n; ++i) {
    int min_dist = manh(a[i], c[0], b[i], d[0]);
    int checkpoint = 1;
    for (int j = 0; j < m; ++j) {
      current_dist = manh(a[i], c[j], b[i], d[j]);
      if (current_dist < min_dist) {
        min_dist = current_dist;
        checkpoint = j + 1;
      }
    }
    cout << checkpoint << endl;
  }
  return 0;
}
int abs(int x) {
  if (x < 0) {
    x = x * (-1);
  }
  return x;
}
int manh(int x1, int x2, int y1, int y2) { return abs(x1 - x2) + abs(y1 - y2); }
