#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using G = vector<vector<int>>;
int di[] = {0, -1, 0, 1};
int dj[] = {1, 0, -1, 0};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<int> a(n), b(n), c(n), d(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 min = INT_MAX;
    int ans = 0;
    for (int j = (0); j < (m); j++) {
      if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < min) {
        ans = j;
        min = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      }
    }
    cout << ans + 1 << endl;
  }
  return 0;
}
