#include <bits/stdc++.h>
using namespace std;
int modul(int a) {
  if (a < 0) return -1;
  return a;
}
struct punct {
  int x, y;
} student[100], control[1000];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) cin >> student[i].x >> student[i].y;
  for (int i = 1; i <= m; ++i) cin >> control[i].x >> control[i].y;
  for (int i = 1; i <= n; ++i) {
    int minim = 1 << 30;
    int p = 0;
    for (int j = 1; j <= m; ++j) {
      if (minim > modul(student[i].x - control[j].x) +
                      modul(student[i].y - control[j].y)) {
        p = j;
        minim = modul(student[i].x - control[j].x) +
                modul(student[i].y - control[j].y);
      }
    }
    cout << p << '\n';
  }
  return 0;
}
