#include <bits/stdc++.h>
#define int long long
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define DEC(i, a, b) for (int i = (a); i > (b); --i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define pb push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
typedef long long ll;
const int INF = (int)1e9;
const int MOD = (int)1e9 + 7;
const ll LINF = (int)1e18;
const double EPS = 1e-9;

signed main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);

  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> student;
  REP(i, n) {
    int a, b;
    cin >> a >> b;
    student.push_back(a, b);
  }
  vector<pair<int, int>> point;
  REP(i, m) {
    int c, d;
    cin >> c >> d;
    point.push_back(c, d);
  }
  for (auto s: student) {
    int ans = 0;
    int distance = LINF;
    int idx;
    for (auto p: point) {
      if (abs(s.first - p.first) + abs(s.second - p.second) < distance)
        ans = idx;
      ++idx;
    }
    cout << ans << endl;
  }
  return 0;
}
