#include <bits/stdc++.h>
using namespace std;
int dist(int x1, int y1, int x2, int y2) { return abs(x1 - x2) + abs(y1 - y2); }
int main() {
  int temp, n, m;
  long long x1[100], y1[100], x2[100], y2[100];
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> x1[i] >> y1[i];
  for (int i = 0; i < m; i++) cin >> x2[i] >> y2[i];
  for (int i = 0; i < n; i++) {
    int temp;
    long long MAX = 100000000;
    for (int j = 0; j < m; j++) {
      int Dist = dist(x1[i], y1[i], x2[j], y2[j]);
      if (Dist < MAX) {
        temp = j;
        MAX = Dist;
      }
    }
    cout << temp + 1 << endl;
  }
  return 0;
}
