#include <bits/stdc++.h>
using namespace std;
constexpr int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
constexpr long long inf = 100000000000000;
int main() {
  int n, m, l = INT_MAX;
  vector<int> x1(n, 0), y1(n, 0), x2(n, 0), y2(n, 0), ans(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> x1[i] >> y1[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> x2[i] >> y2[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (l > (abs(x1[i] - x2[j]) + abs(y1[i] - y2[j]))) {
        l = (abs(x1[i] - x2[j]) + abs(y1[i] - y2[j]));
        ans[i] = j;
      }
    }
    cout << ans[i] + 1 << endl;
  }
  return 0;
}
