#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  cin >> n >> m;
  int a[n], b[n];
  int c[m], d[m], arr[n];
  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++) {
    int ans = 1e9;
    for (int j = 0; j < m; j++) {
      ans = min(ans, abs(a[i] - c[j]) + abs(b[i] - d[j]));
      arr[j] = abs(a[i] - c[j]) + abs(b[i] - d[j]);
    }
    for (int k = 0; k < n; k++) {
      if (arr[k] == ans) {
        cout << k + 1 << endl;
        break;
      }
    }
  }
}
