#include <bits/stdc++.h>
using namespace std;
const int MxN = 1e8;
pair<int, int> a[50], b[50];
void solve() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
  for (int i = 0; i < m; i++) cin >> b[i].first >> b[i].second;
  for (int i = 0; i < n; i++) {
    int min = MxN, k;
    for (int j = 0; j < m; j++) {
      int d = abs(b[j].second - a[i].second) + abs(b[j].first - a[i].first);
      if (d < min) {
        min = d;
        k = j;
      }
    }
    cout << k + 1 << endl;
  }
}
int main() {
  solve();
  return 0;
}
