#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n;
  cin >> m;
  int a[n][2], b[n][2];
  for (int i = 0; i < n; i++) {
    cin >> a[i][0];
    cin >> a[i][1];
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i][0];
    cin >> b[i][1];
  }
  int t[n], s[n];
  for (int i = 0; i < n; i++) {
    t[i] = 400000000;
    for (int j = 0; j < m; j++) {
      int p = abs(a[i][0] - b[j][0]) + abs(a[i][1] - b[j][1]);
      if (t[i] > p) {
        t[i] = p;
        s[i] = j + 1;
      }
    }
    cout << s[i] << endl;
  }
}
