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