#include <bits/stdc++.h>
using namespace std;
template <typename T>
void MACRO_VAR_Scan(T &t) {
  std::cin >> t;
}
template <typename First, typename... Rest>
void MACRO_VAR_Scan(First &first, Rest &...rest) {
  std::cin >> first;
  MACRO_VAR_Scan(rest...);
}
template <typename T>
void MACRO_VEC_ROW_Init(int n, T &t) {
  t.resize(n);
}
template <typename First, typename... Rest>
void MACRO_VEC_ROW_Init(int n, First &first, Rest &...rest) {
  first.resize(n);
  MACRO_VEC_ROW_Init(n, rest...);
}
template <typename T>
void MACRO_VEC_ROW_Scan(int p, T &t) {
  std::cin >> t[p];
}
template <typename First, typename... Rest>
void MACRO_VEC_ROW_Scan(int p, First &first, Rest &...rest) {
  std::cin >> first[p];
  MACRO_VEC_ROW_Scan(p, rest...);
}
template <typename T>
void MACRO_OUT(const T t) {
  std::cout << t;
}
template <class A>
void pr(A a) {
  cout << a;
  cout << '\n';
}
template <class A, class B>
void pr(A a, B b) {
  cout << a << ' ' << b << endl;
}
template <typename T>
T square(T x) {
  return x * x;
}
template <class T>
T GCD(T a, T b) {
  T r;
  while (a) r = b, b = a, a = r % a;
  return b;
}
template <class T>
T LCM(T a, T b) {
  return a / GCD(a, b) * b;
}
bool yes = 0;
bool boo = 0;
int mx = -100000, mn = 100000;
int sum = 0;
int ans = 0;
int co = 0;
int main() {
  int n, m;
  MACRO_VAR_Scan(n, m);
  ;
  int a[n][2], b[m][2];
  for (long long int i = 0; i < (n); i++)
    for (long long int j = 0; j < (2); j++) cin >> a[i][j];
  for (long long int i = 0; i < (m); i++)
    for (long long int j = 0; j < (2); j++) cin >> b[i][j];
  for (long long int i = 0; i < (n); i++) {
    ans = i;
    for (long long int j = 0; j < (m); j++) {
      int n = abs(a[i][0] - b[j][0]) + abs(a[i][1] - b[j][1]);
      if (mn > n) {
        mn = n;
        ans = j;
      }
    }
    pr(ans + 1);
    mn = 100000000;
  }
  return 0;
}
