#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
static const double PI = acos(-1);
static const int INF = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> posx(n);
  vector<int> posy(n);
  vector<int> cx(m);
  vector<int> cy(m);
  for (int i = 0; i < (n); ++i) {
    int a, b;
    cin >> a >> b;
    posx[i] = a;
    posy[i] = b;
  }
  for (int i = 0; i < (m); ++i) {
    int a, b;
    cin >> a >> b;
    cx[i] = a;
    cy[i] = b;
  }
  vector<int> ans(n);
  for (int j = 0; j < (n); ++j) {
    int minlen = 100000009;
    for (int i = 0; i < (m); ++i) {
      int sum = 0;
      sum = abs(posx[j] - cx[i]) + abs(posy[j] - cy[i]);
      if (sum < minlen) {
        ans[j] = i + 1;
        minlen = sum;
      }
    }
  }
  for (auto x : ans) cout << x << endl;
  return 0;
}
