#include using namespace std; using ll = long long; int main() { ll n, t, x1, y1, x2, y2, u, v, cnt = 0, x, y; ll map[27][27] = {0}; vector> num; cin >> n >> t; vector> a, b; for (ll 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 (ll p = 2 * x1 - 1; p < 2 * x2 - 2; p += 2) { for (ll q = 2 * y1 - 1; q < 2 * y2 - 2; q += 2) { map[p][q]++; } } } for (ll i = 1; i < 27; i += 2) { for (ll j = 1; j < 27; j += 2) { num.push_back({map[i][j], i + j}); } } sort(num.begin(), num.end()); ll i = 0; if (num[cnt].first * 30 * 400 >= 10000000) { 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; } cnt++; i++; } for (; i < t; i++) { cin >> u >> v; if (i < 24) { cout << 2 << endl; } else if (i < 300) { if (num[cnt].first * 30 * (399 - i) >= ll(10000000 / sqrt(v))) { 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; } cnt++; } else { cout << 3 << endl; } } else { cout << 3 << endl; } } }