#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int M;
  cin >> N >> M;
  long int a[N];
  long int b[N];
  long int c[M];
  long int d[M];
  for (int i = 0; i < N; i++) {
    cin >> a[i] >> b[i];
  }
  for (int j = 0; j < M; j++) {
    cin >> c[j] >> d[j];
  }
  for (int i = 0; i < N; i++) {
    long int m = abs(a[i] - c[0]) + abs(b[i] - d[0]);
    int n = 0;
    for (int j = 0; j < M; j++) {
      if (abs(a[i] - c[j]) + abs(c[i] - d[j]) < m) {
        m = abs(a[i] - c[j]) + abs(b[i] - d[j]);
        n = j;
      }
    }
    cout << n + 1 << "\n";
  }
}
