#include <bits/stdc++.h>
using namespace std;
long long cmd(long long a, long long b) { return a > b; }
int main() {
  int N, M;
  cin >> N >> M;
  long NN[N], NNN[N];
  long MM[M], MMM[M];
  for (int i = 1; i <= N; i++) cin >> NN[i] >> NNN[i];
  for (int i = 1; i <= M; i++) {
    cin >> MM[i] >> MMM[i];
  }
  for (int j = 1; j <= N; j++) {
    int sum = 999999, place = 0;
    for (int i = 1; i <= M; i++) {
      if (sum > abs(MM[i] - NN[j]) + abs(MMM[i] - NNN[j])) {
        sum = abs(MM[i] - NN[j]) + abs(MMM[i] - NNN[j]);
        place = i;
      }
    }
    cout << place << endl;
  }
  return 0;
}
