#include <bits/stdc++.h>
#include <type_traits>
using namespace std;
using ll = int64_t;
#define int ll
#define FOR(i, a, b) for (int i = int(a); i < int(b); i++)
#define REP(i, b) FOR(i, 0, b)
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(x) x.begin(), x.end()
using pi = pair<int, int>;
using vi = vector<int>;
using ld = long double;

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> a(n), b(n);
    vector<int> c(m), d(m);
    REP(i, n) {
        cin >> a[i] >> b[i];
    }
    REP(i, m) {
        cin >> c[i] >> d[i];
    }

    REP(i, n) {
        int min = 4e8 + 1;
        int ans = 0;
        REP(j, m) {
            int dis = abs(a[i] - c[j]) + abs(b[i] - d[j]);
            if (dis < min) {
                min = dis;
                ans = j + 1;
            }
        }
        cout << ans << endl;
    }
    return 0;
}