#include <bits/stdc++.h>
using namespace std;

using int32 = int_fast32_t;
using int64 = int_fast64_t;

const int32 INF = 1e9;
const int32 MOD = 1e9+7;
const int64 LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define POSSIBLE cout << ((n) ? "POSSIBLE\n" : "IMPOSSIBLE\n"  )
#define ANS(n) cout << (n) << "\n"
#define REP(i,n) for(int64 i=0;i<(n);++i)
#define FOR(i,a,b) for(int64 i=(a);i<(b);i++)
#define FORR(i,a,b) for(int64 i=(a);i>=(b);i--)
#define ALL(obj) (obj).begin(),(obj).end()
#define pii pair<int32,int32>
#define pll pair<int64,int64>
#define pb(a) push_back(a)

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int32 n,m;
  cin >> n >> m;
  vector<complex<int64>> ab(n),cd(m);
  REP(i,n){
    int32 a,b;
    cin >> a >> b;
    ab[i] = complex(a,b);
  }
  REP(i,m){
    int32 c,d;
    cin >> c >> d;
    cd[i] = complex(c,d);
  }
  REP(i,n){
    int32 mn = LLINF;
    int32 ans = -1;
    REP(j,m){
      if(norm(ab[i] - cd[j]) < mn){
        mn = norm<int64>(ab[i] - cd[j]);
        ans = j+1;
      }
    }
    ANS(ans);
  }
  return 0;
}