#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
int md(int a, int b, int c, int d) { return abs(a - c) + abs(b - d); }
int main() {
  int N, M;
  cin >> N >> M;
  vi a(N), b(N);
  for (int i = 0; i < (N); i++) cin >> a.at(i) >> b.at(i);
  vi c(N), d(N);
  for (int i = 0; i < (M); i++) cin >> c.at(i) >> d.at(i);
  for (int i = 0; i < (N); i++) {
    vector<pii> p(M);
    for (int j = 0; j < (M); j++) {
      p.at(j) = make_pair(md(a.at(i), b.at(i), c.at(j), d.at(j)), j + 1);
    }
    sort((p).begin(), (p).end());
    cout << p.at(0).second << endl;
  }
}
