#include <bits/stdc++.h>
using namespace std;
const int inf = 100100100;
const long long INF = 1LL << 60;
const int MOD = (int)1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > s(n);
  vector<pair<int, int> > c(m);
  for (int i = 0; i < n; ++i) cin >> s[i].first >> s[i].second;
  for (int i = 0; i < m; ++i) cin >> c[i].first >> c[i].second;
  vector<int> ans(n);
  for (int i = 0; i < n; ++i) {
    long long x = s[i].first, y = s[i].second;
    long long eans, mnt = inf;
    for (int j = 0; j < m; ++j) {
      long long p = c[j].first, q = c[j].second;
      if (mnt > abs(x - p) + abs(y - q)) {
        eans = j;
        mnt = abs(x - p) + abs(y - q);
      }
    }
    ans[i] = eans + 1;
  }
  for (auto x : ans) cout << x << endl;
  ;
}
