#include <bits/stdc++.h>
using li = unsigned long long int;
using namespace std;
class Point {
 public:
  long long x_, y_;
  Point(long long x, long long y) : x_{x}, y_{y} {}
  long long operator*(Point o) { return abs(x_ - o.x_) + abs(y_ - o.y_); }
};
int main() {
  (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false));
  int n, m;
  cin >> n >> m;
  vector<Point> students;
  for (int i = 0; i < (n); ++i) {
    li a, b;
    cin >> a >> b;
    students.push_back(Point(a, b));
  }
  vector<Point> checkpoints;
  for (int i = 0; i < (m); ++i) {
    li c, d;
    cin >> c >> d;
    checkpoints.push_back(Point(c, d));
  }
  for (int i = 0; i < (n); ++i) {
    li min_dist = 100000001 * 2;
    int coord = 0;
    for (int j = 0; j < (m); ++j) {
      li cur_dist = students.at(i) * checkpoints.at(j);
      if (min_dist > cur_dist) {
        min_dist = cur_dist;
        coord = j + 1;
      }
    }
    cout << coord << endl;
  }
}
