#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
template<class T> inline bool chmax(T& a, T b) {if (a<b) {a=b; return true;} return false;}
template<class T> inline bool chmin(T& a, T b) {if (a>b) {a=b; return true;} return false;}

const ll MOD = 1000000007;
const ll HIGHINF = (ll)1e18;
// ||

int main() {
  ll n, m; cin >> n >> m;
  vll a(n), b(n);
  REP(i, n) cin >> a[i] >> b[i];
  vll c(m), d(m);
  REP(i, m) cin >> c[i] >> d[i];
  REP(i, n) {
    ll maxj=0, mind=abs(a[i]-c[0])+abs(b[i]-d[0]);
    rep(j, 1, m) {
      ll tmpd = abs(a[i]-c[j])+abs(b[i]-d[j]);
      if (tmpd < mind) {
        maxj = j; mind=tmpd;
      }
    }
    cout << j+1 << endl;
  }
  return 0;
}
