#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int MOD = 1000000007;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(N), b(N), c(M), d(M);
  for (int i = 0; i < (N); i++) {
    cin >> a[i] >> b[i];
  }
  for (int j = 0; j < (N); j++) {
    cin >> c[j] >> d[j];
  }
  for (int i = 0; i < (N); i++) {
    int ans = 100000000, ans_num;
    for (int j = 0; j < (M); j++) {
      if ((abs(c[j] - a[i]) + abs(d[j] - b[i])) < ans) {
        ans = (abs(c[j] - a[i]) + abs(d[j] - b[i]));
        ans_num = j;
      }
    }
    cout << ans_num + 1 << endl;
  }
  return 0;
}
