#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  int n, m;
  pair<int, int> student[50], point[50];
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> student[i].first >> student[i].second;
  }
  for (int i = 0; i < m; i++) {
    cin >> point[i].first >> point[i].second;
  }
  for (int i = 0; i < n; i++) {
    int ans = 0, dis = 400000000;
    for (int j = 0; j < n; j++) {
      if (dis > abs(student[i].first - point[j].first) +
                    abs(student[i].second - point[j].second)) {
        ans = j + 1;
        dis = abs(student[i].first - point[j].first) +
              abs(student[i].second - point[j].second);
      }
    }
    cout << ans << "\n";
  }
}
