#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, Count, temp;
  int *a, *b, *c, *d, *ans;
  cin >> N >> M;
  a = new int[N];
  b = new int[N];
  c = new int[N];
  d = new int[N];
  ans = new int[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];
  for (int i = 0, j = 0; i < M; i++) {
    ans[i] = abs(a[j] - c[i]) + abs(b[j] - d[i]);
    if (i == M - 1) {
      temp = ans[0];
      Count = 0;
      for (int k = 0; k < M; k++) {
        if (temp > ans[k]) {
          temp = ans[k];
          Count = k;
        }
      }
      i = -1;
      j++;
      cout << Count + 1 << endl;
      if (j == N) break;
    }
  }
  return 0;
}
