#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  pair<int, int> s[55];
  pair<int, int> c[55];
  for (int i = 1; i <= n; i++) cin >> s[i].first >> s[i].second;
  for (int i = 1; i <= m; i++) cin >> c[i].first >> c[i].second;
  for (int i = 1; i <= n; i++) {
    int ans;
    int D = 9999999;
    for (int j = 1; j <= m; j++) {
      int d = abs(s[i].first - c[j].first) + abs(s[i].second - c[j].second);
      if (d < D) {
        D = d;
        ans = j;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
