#include <bits/stdc++.h>
using namespace std;
class cPOINT {
 public:
  long lnX;
  long lnY;
  cPOINT() {
    lnX = 0;
    lnY = 0;
  };
  cPOINT &operator=(const cPOINT &obj);
  cPOINT operator-(const cPOINT &obj);
  double calc();
};
cPOINT &cPOINT::operator=(const cPOINT &obj) {
  lnX = obj.lnX;
  lnY = obj.lnY;
  return *this;
}
cPOINT cPOINT::operator-(const cPOINT &obj) {
  cPOINT cTmp;
  cTmp.lnX = this->lnX - obj.lnX;
  cTmp.lnY = this->lnY - obj.lnY;
  return cTmp;
}
double cPOINT::calc() {
  double dbPowX = pow(lnX, 2);
  double dbPowY = pow(lnY, 2);
  return sqrt(dbPowX + dbPowY);
}
int main() {
  long lnCntN;
  long lnCntM;
  cin >> lnCntN;
  cin >> lnCntM;
  vector<cPOINT> vecN(lnCntN);
  vector<cPOINT> vecM(lnCntM);
  for (int i = 0; i < lnCntN; i++) {
    cPOINT stAdd;
    cin >> stAdd.lnX;
    cin >> stAdd.lnY;
    vecN[i] = stAdd;
  }
  for (int i = 0; i < lnCntM; i++) {
    cPOINT stAdd;
    cin >> stAdd.lnX;
    cin >> stAdd.lnY;
    vecM[i] = stAdd;
  }
  for (int i = 0; i < lnCntN; i++) {
    int nIdxM = 0;
    double dbNearVal = DBL_MAX;
    for (int j = 0; j < lnCntM; j++) {
      cPOINT cTmp = vecN[i] - vecM[j];
      double dbVal = cTmp.calc();
      if (dbVal < dbNearVal) {
        dbNearVal = dbVal;
        nIdxM = j;
      }
    }
    if (i == lnCntN - 1)
      cout << nIdxM + 1;
    else
      cout << nIdxM + 1 << endl;
  }
  return 0;
}
