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