#include <bits/stdc++.h>
using namespace std;
int manhattan(int x1, int y1, int x2, int y2) {
  return abs(x1 - x2) + abs(y1 - y2);
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<vector<int>> vec(M);
  for (int i = 0; i < M; i++) {
    cin >> vec[M][0] >> vec[M][1];
  }
  int tmp, cnt;
  int a, b;
  for (int i = 0; i < N; i++) {
    cin >> a >> b;
    tmp = 0;
    cnt = manhattan(vec[0][0], vec[0][1], a, b);
    for (int j = 1; j < M; j++) {
      if (manhattan(vec[j][0], vec[j][1], a, b) < cnt) {
        cnt = manhattan(vec[j][0], vec[j][1], a, b);
        tmp = j;
      }
    }
    cout << tmp << endl;
  }
}
