#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  pair<int, int> s[N], c[M];
  for (int i = 0; i < N; i++) {
    cin >> s[i].first >> s[i].second;
  }
  for (int i = 0; i < M; i++) {
    cin >> c[i].first >> c[i].second;
  }
  for (int si = 0; si < N; si++) {
    int min = 1e9;
    int min_ci = 0;
    for (int ci = 0; ci < M; ci++) {
      int tmp =
          abs(s[si].first - c[ci].first) + abs(s[si].second - c[ci].second);
      cout << abs(s[si].second - c[ci].second) << endl;
      if (tmp < min) {
        min = tmp;
        min_ci = ci;
      }
      cout << tmp << " " << min << endl;
    }
    cout << min_ci + 1 << endl;
  }
  return 0;
}
