#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  int a[51], b[51];
  int c[51], d[51];
  int min[51];
  int ans[51];
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    min[i] = 200000000;
  }
  for (int i = 0; i < m; i++) {
    cin >> c[i] >> d[i];
  }
  int ch[n][m];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      ch[i][j] = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (ch[i][j] < min[i]) {
        min[i] = ch[i][j];
        ans[i] = j + 1;
      }
    }
    cout << ans[i] << endl;
  }
}
