#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;
double EPS = 1e-8;
const double PI = acos(-1);
int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, -1, 1};
struct xy {
  int x;
  int y;
};
int main() {
  int n, m;
  cin >> n >> m;
  xy student[60], check[60];
  for (int i = 0; i < n; i++) {
    cin >> student[i].x >> student[i].y;
  }
  for (int j = 0; j < m; j++) {
    cin >> check[j].x >> check[j].y;
  }
  int tmp;
  for (int k = 0; k < n; k++) {
    int min = 10000000 * 4;
    for (int l = 0; l < m; l++) {
      int kyori =
          abs(student[k].x - check[l].x) + abs(student[k].y - check[l].y);
      if (min > kyori) {
        min = kyori;
        tmp = l;
      }
    }
    cout << tmp + 1 << endl;
  }
}
