#include <bits/stdc++.h>
using namespace std;
int mdis(int ax, int ay, int bx, int by) {
  int re = abs(ax - bx) + abs(ay - by);
  return re;
}
int main() {
  int N, M;
  cin >> N >> M;
  if (N != 1) {
    vector<int> a(N), b(N), c(M), d(M);
    for (int i = 0; i < N; i++) {
      cin >> a.at(i) >> b.at(i);
    }
    for (int i = 0; i < M; i++) {
      cin >> c.at(i) >> d.at(i);
    }
    vector<vector<int>> list(N, (vector<int>(M)));
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < M; j++) {
        list.at(i).at(j) = mdis(a.at(i), b.at(i), c.at(j), d.at(j));
      }
    }
    vector<int> sorted(M);
    int min;
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < M; j++) {
        sorted.at(j) = list.at(i).at(j);
      }
      sort(sorted.begin(), sorted.end());
      min = sorted.at(0);
      for (int j = 0; j < N; j++) {
        if (min == list.at(i).at(j)) {
          cout << j + 1 << endl;
          break;
        }
      }
    }
  } else {
    int locx, locy;
    cin >> locx >> locy;
    vector<int> c(M), d(M);
    for (int i = 0; i < M; i++) {
      cin >> c.at(i) >> d.at(i);
    }
    int answer = 1;
    int min = 99999999;
    for (int i = 0; i < M; i++) {
      if (mdis(locx, locy, c.at(i), d.at(i)) < min) {
        min = mdis(locx, locy, c.at(i), d.at(i));
      }
    }
    cout << min << endl;
  }
}
