#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, minv, ans;
  static const int INF = 2e8;
  scanf("%d", &n);
  scanf("%d", &m);
  pair<int, int> A[n], B[m];
  for (int i = 0; i < n; i++) {
    scanf("%d", &A[i].first);
    scanf("%d", &A[i].second);
  }
  for (int i = 0; i < m; i++) {
    scanf("%d", &B[i].first);
    scanf("%d", &B[i].second);
  }
  for (int i = 0; i < n; i++) {
    minv = INF;
    for (int j = 0; j < m; j++) {
      if (minv >
          abs(A[i].first - B[j].first) + abs(A[i].second - B[j].second)) {
        minv = abs(A[i].first - B[j].first) + abs(A[i].second - B[j].second);
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
