#include <bits/stdc++.h>
using namespace std;
void Lancer() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
bool isPrime(long long n) {
  if (n == 2 || n == 3 || n == 5)
    return true;
  else if (n % 2 == 0 || n % 3 == 0 || n % 5 == 0 || n == 1)
    return false;
  else {
    for (int i = 5; i <= sqrt(n); i += 2) {
      if (n % i == 0) return false;
    }
    return true;
  }
}
int stud[57][2], pnt[57][2], frq[57];
int main() {
  Lancer();
  long long n, m, res, dis, indx = 0;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> stud[i][0] >> stud[i][1];
  for (int i = 0; i < m; i++) cin >> pnt[i][0] >> pnt[i][1];
  for (int i = 0; i < n; i++) {
    res = 200000008;
    for (int j = 0; j < m; j++) {
      if (!frq[j]) {
        dis = abs(stud[i][0] - pnt[j][0]) + abs(stud[i][1] - pnt[j][1]);
        if (dis < res) {
          indx = j + 1;
          res = dis;
        }
      }
    }
    frq[indx - 1] = 1;
    cout << indx << "\n";
  }
  return 0;
}
