#include <iostream>
#include <utility>
#include <map>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <array>
#include <math.h>
#include <numeric>
#include <sstream>
typedef long long ll;
using namespace std;
int main(int argc, char const *argv[]) {
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    vector<int> b(n);
    vector<int> c(m);
    vector<int> d(m);
    vector<int> ans(n);
    int INF = 1 << 29;
    for (int i = 0; i < n; ++i) cin >> a[i] >> b[i];
    for (int i = 0; i < m; ++i) cin >> c[i] >> d[i];
    for (int i = 0; i < n; ++i) {
        int min = INF;
        for (int j = 0; j < m; ++j) {
            int t = (abs(a[i]-c[j]) + abs(b[i]-d[j]));
            if (t < min) {
                min = dis;
                ans[i] = j+1;
            }
        }
    }
    for (int i = 0; i < n; ++i) cout << ans[i] << std::endl;
    return 0;
}