#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int dis, dis_min, dis_min_index;
  long 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];
  for (int i = 0; i < n; i++) {
    dis = 0;
    dis_min = 99999999;
    dis_min_index = 0;
    for (int j = 0; j < m; j++) {
      dis = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (dis < dis_min) {
        dis_min = dis;
        dis_min_index = j;
      }
    }
    cout << dis_min_index + 1 << "\n";
  }
}
