#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  pair<int, int> st[n], g[m];
  for (int i = 0; i < n; i++) cin >> st[i].first >> st[i].second;
  for (int i = 0; i < m; i++) cin >> g[i].first >> g[i].second;
  int cal, ans[n];
  for (int i = 0; i < n; i++) {
    pair<int, int> tmp = make_pair(10000, 0);
    for (int j = 0; j < m; j++) {
      cal = abs(st[i].first - g[j].first) + abs(st[i].second - g[j].second);
      if (cal < tmp.first) tmp = make_pair(cal, j + 1);
    }
    ans[i] = tmp.second;
  }
  for (int i = 0; i < n; i++) cout << ans[i] << endl;
}
