#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> a(n + 1), b(n + 1);
  for (int i = 0; i < n; i++) {
    int A, B;
    cin >> A >> B;
    a[i].first = A;
    a[i].second = B;
  }
  for (int i = 0; i < m; i++) {
    int A, B;
    cin >> A >> B;
    b[i].first = A;
    b[i].second = B;
  }
  vector<int> ans(n);
  for (int i = 0; i < n; i++) {
    int mn = 1000000000;
    for (int j = 0; j < m; j++) {
      mn = min(mn,
               abs(a[i].first - b[j].first) + abs(a[i].second - b[j].second));
    }
    for (int j = 0; j < m; j++) {
      if (abs(a[i].first - b[j].first) + abs(a[i].second - b[j].second) == mn) {
        ans[i] = j;
        break;
      }
    }
  }
  for (int i = 0; i < n; i++) cout << ans[i] + 1 << endl;
}
