#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, m;
  cin >> n >> m;
  vector<pair<int, int>> student(n, pair<int, int>());
  vector<pair<int, int>> checkpoint(n, pair<int, int>());
  for (int i = 0; i < n; i++) cin >> student[i].first >> student[i].second;
  for (int i = 0; i < m; i++)
    cin >> checkpoint[i].first >> checkpoint[i].second;
  for (int i = 0; i < n; i++) {
    long ans;
    long min_distance = 99999999999;
    for (int j = 0; j < m; j++) {
      long distance;
      if (student[i].first >= checkpoint[j].first)
        distance = student[i].first - checkpoint[j].first;
      else
        distance = checkpoint[j].first - student[i].first;
      if (student[i].second >= checkpoint[j].second)
        distance += student[i].second - checkpoint[j].second;
      else
        distance += checkpoint[j].second - student[i].second;
      if (distance < min_distance) {
        min_distance = distance;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
}
