#include using namespace std; int main() { long long n, t, x1, y1, x2, y2, u, v, cnt = 0, x, y; bool ok = false; long long map[27][27] = {0}; vector> num; cin >> n >> t; vector> a, b; for (long long i = 0; i < n; i++) { cin >> x1 >> y1; a.push_back({x1, y1}); cin >> x2 >> y2; b.push_back({x2, y2}); if (x1 > x2) { swap(x1, x2); } if (y1 > y2) { swap(y1, y2); } for (long long p = 2 * x1 - 1; p < 2 * x2 - 2; p += 2) { for (long long q = 2 * y1 - 1; q < 2 * y2 - 2; q += 2) { map[p][q]++; } } } for (long long i = 1; i < 27; i += 2) { for (long long j = 1; j < 27; j += 2) { num.push_back({map[i][j], i + j}); } } sort(num.begin(), num.end()); for (long long i = 0; i < t; i++) { cin >> u >> v; if (i < 99) { cout << 2 << endl; } else if (i < 300) { if (u >= 1000000) { ok = true; } if (ok) { x = num[cnt].second % 27; y = num[cnt].second / 27; if (x % 2 == 1) { cout << 1 << " " << x / 2 + 1 << " " << y / 2 + 1 << " " << x / 2 + 2 << " " << y / 2 + 1 << endl; } else { cout << 1 << " " << x / 2 + 1 << " " << y / 2 + 1 << " " << x / 2 + 1 << " " << y / 2 + 2 << endl; } } else { cout << 3 << endl; } } else { cout << 3 << endl; } ok = false; } }