#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T& a, T b);
template <class T>
bool chmin(T& a, T b);
int* eratosthenes(int N);
bool bit_search(int pattern, int N);
template <class T>
void cumulative_sum(T array, size_t N);
const long long int INF = 1LL << 60;
const int k_mod = 1e9 + 7;
typedef struct {
  vector<int> to;
  int cost;
} edge;
int main(void) {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int> > st(N), ch(M);
  for (int i = (0); i < (N); i++) {
    int x, y;
    cin >> x >> y;
    st[i] = pair<int, int>{x, y};
  }
  for (int i = (0); i < (M); i++) {
    int x, y;
    cin >> x >> y;
    ch[i] = pair<int, int>{x, y};
  }
  for (auto s : st) {
    int x = s.first, y = s.second;
    long long int distance = INF;
    int index = 0;
    for (int i = (0); i < (N); i++) {
      if (abs(ch[i].first - x) + abs(ch[i].second - y) < distance) {
        distance = abs(ch[i].first - x) + abs(ch[i].second - y);
        index = i + 1;
      }
    }
    cout << index << endl;
  }
}
int* eratosthenes(int N) {
  int* prime_array = new int[N + 1];
  int lim = N;
  prime_array[0] = 0;
  prime_array[1] = 0;
  for (int i = (2); i < (N + 1); i++) {
    prime_array[i] = 1;
  }
  for (int i = (2); i < (lim); i++) {
    if (prime_array[i] == 0) continue;
    lim = N / i;
    for (int j = i * 2; j < N + 1; j += i) {
      prime_array[j] = 0;
    }
  }
  return prime_array;
}
template <class T>
void cumulative_sum(T array, size_t N) {
  for (int i = (1); i < (N + 1); i++) {
    array[i] += array[i - 1];
  }
}
template <class T>
bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
bool bit_search(int pattern, int N) {
  int cnt = 0;
  for (int bit = (0); bit < (N); bit++) {
    if (pattern & (1 << bit)) {
      cnt++;
    }
  }
  return true;
}
