#include <bits/stdc++.h>
using namespace std;
int N, M;
int A[50], B[50];
int C[50], D[50];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  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 x = A[i], y = B[i];
    int m = INT_MAX, mi = -1;
    for (int j = 0; j < (M); j++) {
      int d = abs(C[j] - x) + abs(D[j] - y);
      if (d < m) {
        m = d;
        mi = j;
      }
    }
    cout << mi + 1 << "\n";
  }
  return 0;
}
