#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int nmax = 50;
  int a[nmax], b[nmax], c[nmax], d[nmax];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  for (int j = 0; j < m; j++) {
    cin >> c[j] >> d[j];
  }
  for (int i = 0; i < n; i++) {
    int min_d = abs(a[i] - c[0]) + abs(a[i] - c[0]), checkpoint = 1;
    for (int j = 1; j < m; j++) {
      int cu_d = abs(a[i] - c[j]) + abs(b[i] - c[j]);
      if (min_d > cu_d) {
        min_d = cu_d;
        checkpoint = j + 1;
      }
    }
    cout << checkpoint << endl;
  }
  return 0;
}
