#include <bits/stdc++.h>
using namespace std;
struct student {
  long long a;
  long long b;
};
struct xyza {
  long long c;
  long long d;
};
void lnma(struct student s[], struct xyza za[], int n, int m, long long ln[]) {
  for (int i = 0; i < n; i++) {
    long long min = 4 * 100000000;
    int ans;
    for (int j = 0; j < m; j++) {
      int X, Y;
      X = (s[i].a >= za[j].c) ? s[i].a - za[j].c : za[j].c - s[i].a;
      Y = (s[i].b >= za[j].d) ? s[i].b - za[j].d : za[j].d - s[i].b;
      if (min > X + Y) {
        min = X + Y;
        ans = j;
      }
    }
    ln[i] = ans + 1;
  }
}
int main() {
  struct xyza xy[50];
  struct student stu[50];
  int n, m;
  cin >> n >> m;
  long long eachln[m];
  for (int i = 0; i < n; i++) {
    cin >> stu[i].a >> stu[i].b;
  }
  for (int j = 0; j < m; j++) {
    cin >> xy[j].c >> xy[j].d;
  }
  for (int i = 0; i < n; i++) {
    lnma(stu, xy, n, m, eachln);
  }
  for (int i = 0; i < n; i++) {
    cout << eachln[i] << endl;
  }
}
