#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class A>
void pr(A a) {
  cout << a;
  cout << '\n';
}
template <class A, class B>
void pr(A a, B b) {
  cout << a << ' ';
  pr(b);
}
template <class A, class B, class C>
void pr(A a, B b, C c) {
  cout << a << ' ';
  pr(b, c);
}
template <class A, class B, class C, class D>
void pr(A a, B b, C c, D d) {
  cout << a << ' ';
  pr(b, c, d);
}
template <class A>
void PR(A a, long long n) {
  for (int i = 0; i < (n); ++i) {
    if (i) cout << ' ';
    cout << a[i];
  }
  cout << '\n';
}
int GCD(int a, int b) { return b ? GCD(b, a % b) : a; }
const long long INF = 1LL << 60;
int main() {
  int N, M;
  cin >> N >> M;
  long a[60] = {0};
  long b[60] = {0};
  for (int i = 0; i < (N); ++i) cin >> a[i] >> b[i];
  long c[60] = {0};
  long d[60] = {0};
  for (int i = 0; i < (M); ++i) cin >> c[i] >> d[i];
  for (int i = 0; i < (N); ++i) {
    long res = 100000100;
    int check_point = 1;
    for (int j = 0; j < (M); ++j) {
      long len = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (res > len) {
        res = len;
        check_point = j + 1;
      }
    }
    pr(check_point);
  }
}
