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