#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int m;
  cin >> n >> m;
  int a[n][n], b[m][m];
  for (int i = 0; i < n; i++) {
    for (int ii = 0; ii < 2; ii++) {
      cin >> a[i][ii];
    }
  }
  for (int k = 0; k < m; k++) {
    for (int kk = 0; kk < 2; kk++) {
      cin >> b[k][kk];
    }
  }
  int ans[n];
  for (int j = 0; j < n; j++) {
    int ansnum = m;
    for (int v = 0; v < m; v++) {
      int sum = 0;
      for (int jj = 0; jj < 2; jj++) {
        int t = a[j][jj] - b[v][jj];
        if (t < 0) {
          t = -t;
        }
        sum = sum + t;
      }
      if (sum < m) {
        ansnum = v + 1;
      }
    }
    cout << ansnum << endl;
  }
  return 0;
}
