#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  pair<long long int, long long int> student[n];
  pair<long long int, long long int> check[m];
  for (int i = 0; i < n; ++i) {
    long long int a, b;
    cin >> a >> b;
    student[i] = make_pair(a, b);
  }
  for (int i = 0; i < m; ++i) {
    long long int c, d;
    cin >> c >> d;
    check[i] = make_pair(c, d);
  }
  for (int i = 0; i < n; ++i) {
    long long int max1 = 200000001;
    int k = -1;
    for (int j = 0; j < m; ++j) {
      if (max1 > abs(student[i].first - check[j].first) +
                     abs(student[i].second - check[j].second)) {
        max1 = abs(student[i].first - check[j].first) +
               abs(student[i].second - check[j].second);
        k = j;
      }
    }
    cout << k + 1 << "\n";
  }
}
