#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
using namespace std;
void CINT() {}
template <class Head, class... Tail>
void CINT(Head&& head, Tail&&... tail) {
  cin >> head;
  CINT(move(tail)...);
}
template <class T = long long>
T IN() {
  T x;
  cin >> x;
  return (x);
}
template <class Head>
void VT(Head head) {}
template <class Head, class Seco, class... Tail>
void VT(Head&& head, Seco&& seco, Tail&&... tail) {
  seco.resize(head);
  VT(head, move(tail)...);
}
void VT2() {}
template <class Head, class... Tail>
void VT2(Head&& head, Tail&&... tail) {
  for (auto& youso_ : (head)) cin >> youso_;
  VT2(move(tail)...);
}
template <class Head>
void VT3(Head&& head) {}
template <class Head, class Seco, class... Tail>
void VT3(Head&& head, Seco&& seco, Tail&&... tail) {
  seco[head] = IN();
  VT3(head, move(tail)...);
}
int main() {
  int n, m;
  CINT(n, m);
  vector<long long> a, b;
  VT(n, a, b);
  for (int i = 0; i < (n); ++i) VT3(i, a, b);
  ;
  vector<long long> c, d;
  VT(m, c, d);
  for (int i = 0; i < (m); ++i) VT3(i, c, d);
  ;
  for (int i = 0; i < (n); ++i) {
    long long num = 0;
    long long dist = LINF;
    for (int j = 0; j < (m); ++j) {
      if (dist > abs(a[i] - c[j]) + abs(b[i] - d[j])) {
        dist = abs(a[i] - c[j]) + abs(d[j] - b[i]);
        num = j++;
      }
    }
    cout << (num) << endl;
  }
  return 0;
}
