#include <bits/stdc++.h>
using namespace std;
class MYCP {
 public:
  static string MakeString_LongLong(vector<long long> const& numbers,
                                    string const& str) {
    if (numbers.size() == 0) return "";
    string result = "" + to_string(numbers[0]);
    for (long long i = 1; i < numbers.size(); i++) {
      result += str;
      result += to_string(numbers[i]);
    }
    return result;
  }
  static string MakeString_LongLong(vector<long long> const& numbers) {
    if (numbers.size() == 0) return "";
    string result = "" + to_string(numbers[0]);
    for (long long i = 1; i < numbers.size(); i++) {
      result += " ";
      result += to_string(numbers[i]);
    }
    return result;
  }
  static string MakeString_VectorString(vector<string> const& str) {
    string result = "";
    for (long long i = 0; i < str.size(); i++) {
      result += str[i] + "\n";
    }
    return result;
  }
  static vector<string> MyReadLineSplit(long long n) {
    vector<string> str(n);
    for (long long i = 0; i < n; i++) {
      std::cin >> str[i];
    }
    return str;
  }
  static vector<long long> ReadInts(long long number) {
    vector<long long> a(number);
    for (int i = 0; i < number; i++) {
      std::cin >> a[i];
    }
    return a;
  }
  static bool PrimeCheck_Int(long long number) {
    if (number < 2) return false;
    for (unsigned long long i = 2; i * i <= number; i++) {
      if (number % i == 0) return false;
    }
    return true;
  }
  static vector<long long> MakePrimeList(long long n) {
    vector<long long> list;
    long long i, j, p;
    bool flag;
    for (i = 2; i <= n; i++) {
      flag = true;
      for (j = 0; j < list.size(); j++) {
        if (!(list[j] * list[j] <= i)) break;
        if (i % list[j] == 0) {
          flag = false;
          break;
        }
      }
      if (flag) list.push_back(i);
    }
    return list;
  }
  static vector<string> split(string const& str, char sep) {
    vector<std::string> v;
    auto first = str.begin();
    while (first != str.end()) {
      auto last = first;
      while (last != str.end() && *last != sep) last++;
      v.push_back(string(first, last));
      if (last != str.end()) last++;
      first = last;
    }
    return v;
  }
  static long long Sum(vector<long long> a) {
    long long i, sum = 0;
    for (i = 0; i < a.size(); i++) {
      sum += a[i];
    }
    return sum;
  }
  static bool Komoji(char a) {
    if (a >= 'a' && a <= 'z') return true;
    return false;
  }
  static bool Oomoji(char a) {
    if (a >= 'A' && a <= 'Z') return true;
    return false;
  }
  static long long GreatestCommonFactor(long long a, long long b) {
    long long temp;
    if (a < b) {
      temp = b;
      b = a;
      a = temp;
    }
    while (true) {
      temp = a % b;
      a = b;
      b = temp;
      if (b == 0) break;
    }
    return a;
  }
  static long long LeastCommonMultiple(long long a, long long b) {
    return (a / GreatestCommonFactor(a, b)) * b;
  }
};
class Syakutori {
 private:
  vector<long long> list;

 public:
  void MakeArray(vector<long long> data) {
    long long i;
    list = data;
    list.push_back(0);
    list[0] = 0;
    for (i = 1; i < list.size(); i++) {
      list[i] = list[i - 1] + data[i - 1];
    }
  }
  long long Sum(long long start, long long end) {
    if (end < start) {
      cout << "startがendより大きいです";
      return 0;
    }
    if (start < 0 || end >= list.size()) {
      cout << "範囲が異常";
      return 0;
    }
    return list[end] - list[start];
  }
};
string strnum = "0123456789";
string alpS = "abcdefghijklmnopqrstuvwxyz";
string alpL = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int sizealp = (int)(alpS.size());
int main(void) {
  int n, m;
  cin >> n >> m;
  vector<int> a(n), b(n), c(m), d(m);
  for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
  for (int i = 0; i < m; i++) cin >> c[i] >> d[i];
  vector<int> mdis(n);
  for (int i = 0; i < n; i++) {
    int min = abs(c[0] - a[i]) + abs(d[0] - b[i]);
    int j = 0;
    for (; j < m; j++) {
      if (min > abs(c[j] - a[i]) + abs(d[j] - b[i])) {
        min = abs(c[j] - a[i]) + abs(d[j] - b[i]);
      }
    }
    mdis[i] = j;
  }
  for (int i = 0; i < n; i++) cout << mdis[i] << endl;
  return 0;
}
