#include <bits/stdc++.h>
using namespace std;
int N, M;
const int MAX_N = 50, MAX_M = 50;
int a[MAX_N], b[MAX_N], c[MAX_M], d[MAX_M];
int p[MAX_N];
void solve() {
  for (int i = 0; i < N; i++) {
    int minD = 100000000;
    for (int j = 0; j < M; j++) {
      if (minD > (abs(a[i] - c[j]) + abs(b[i] - d[j]))) {
        minD = (abs(a[i] - c[j]) + abs(b[i] - d[j]));
        p[i] = j + 1;
      }
    }
  }
  for (int i = 0; i < N; i++) {
    cout << p[i] << endl;
  }
}
int main() {
  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];
  }
  solve();
  return 0;
}
