#include <bits/stdc++.h>
using namespace std;
long long calc(pair<long long, long long> a, pair<long long, long long> b) {
  return abs(a.first - b.first) + abs(a.second - b.second);
}
int main(void) {
  int n, m;
  cin >> n >> m;
  vector<pair<long long, long long> > student;
  vector<pair<long long, long long> > checkpoint;
  for (int i = 0; i < n; i++) {
    pair<long long, long long> coor;
    cin >> coor.first >> coor.second;
    student.push_back(coor);
  }
  for (int i = 0; i < m; i++) {
    pair<long long, long long> coor;
    cin >> coor.first >> coor.second;
    checkpoint.push_back(coor);
  }
  for (int i = 0; i < n; i++) {
    int res = 1;
    long long d = 1e8;
    for (int j = 0; j < m; j++) {
      long long man = calc(student[i], checkpoint[j]);
      if (d > man) {
        d = man;
        res = j + 1;
      }
    }
    cout << res << endl;
  }
  return 0;
}
