#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<pair<int, int> > stu;
  vector<pair<int, int> > che;
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    stu.push_back(make_pair(a, b));
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    che.push_back(make_pair(a, b));
  }
  int ans = 1e6, temp = 0, res = 0, j = 0;
  for (int i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      res =
          abs(stu[i].first - che[j].first) + abs(stu[i].second - che[j].second);
      if (res < ans) {
        temp = j + 1;
        ans = res;
      }
    }
    if (temp == 0) {
      cout << j + 1 << endl;
    } else {
      cout << temp << endl;
    }
    temp = 0, ans = 1e6;
  }
  return 0;
}
