#include <bits/stdc++.h>
#define INF 1000000007
using namespace std;

int nearest_checkpoint(int , int y, int m, int c[], int d[]) {
  int ret = 0, ds = INF;
  for (int i = 0; i < m; i++) {
    nds = abs(x - c[i]) + abs(y - d[i]);
    if (nds < ds) {
      ds = nds;
      ret = i;
    }
  }
  return ret;
}

int main() {
  int n, m;
  cin >> n >> m;
  int a[n], b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  int c[m], d[m];
  for (int i = 0; i < m; i++) {
    cin >> c[i] >> d[i];
  }
  for (int i = 0; i < n; i++) {
    cout << nearest_checkpoint(a[i], b[i], m, c, d) << endl;
  }
  return 0;
}