#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  long long a[N], b[N], 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];
  for (int i = 0; i < N; i++) {
    int MinDist = 1 << 50, MinIndex = 0, CurDist;
    for (int j = 0; j < M; j++) {
      CurDist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (CurDist < MinDist) {
        MinDist = CurDist;
        MinIndex = j + 1;
      }
    }
    cout << MinIndex << endl;
  }
}
