#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  int n, m, a[55] = {}, b[55] = {}, c, d;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i] >> b[i];
  for (int i = 1; i <= m; i++) {
    cin >> c >> d;
    int x = mod, y = 0;
    for (int j = 1; j <= n; j++)
      if (abs(a[j] - c) + abs(b[j] - d) < x)
        x = abs(a[j] - c) + abs(b[j] - d), y = j;
    cout << y << '\n';
  }
}
