#include <bits/stdc++.h>
using namespace std;
int n, m;
struct mm {
  int x;
  int y;
} a[100005], b[100005];
int sum[100005];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].x >> a[i].y;
  }
  for (int j = 1; j <= m; j++) {
    cin >> b[j].x >> b[j].y;
  }
  for (int i = 1; i <= n; i++) {
    int maxx = 1 << 30;
    for (int j = 1; j <= m; j++) {
      if ((abs(a[i].x - b[j].x) + abs(a[i].y - b[j].y)) < maxx) {
        maxx = abs(a[i].x - b[j].x) + abs(a[i].y - b[j].y);
      }
      sum[i] = j;
    }
    cout << sum[i] << endl << maxx;
  }
  return 0;
}
