#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  int i, j;
  cin >> N >> M;
  int a[N], b[N], c[M], d[M];
  for (i = 0; i < N; i++) {
    cin >> a[i] >> b[i];
  }
  for (i = 0; i < N; i++) {
    cin >> c[i] >> d[i];
  }
  for (i = 0; i < N; i++) {
    int min = abs(a[i] - c[0]) + abs(b[i] - d[0]), flag = 1;
    for (j = 0; j < M; j++) {
      int cur = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (min > cur) {
        min = cur;
        flag = 1 + j;
      }
    }
    cout << flag << endl;
  }
  return 0;
}
