#include <bits/stdc++.h>
const int INF = 100100100;
using namespace std;
int main() {
  int N, M;
  int a[51], b[51], c[51], d[51];
  int res[51];
  cin >> N >> 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 minmd = INF;
    for (int j = 0; j < M; j++) {
      int md = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (minmd > md) {
        res[i] = j + 1;
        minmd = md;
      }
    }
  }
  for (int i = 0; i < N; i++) {
    cout << res[i] << endl;
  }
}
