#include #include using namespace std; using namespace atcoder; using ll = long long; using P = pair; using mint = modint998244353; #define rep(i, a, b) for(ll i = a; i < b; i++) #define rrep(i, a, b) for(ll i = a; i >= b; i--) constexpr ll inf = 4e18; struct RandomNumberGenerator { mt19937_64 mt; RandomNumberGenerator() : mt(chrono::steady_clock::now().time_since_epoch().count()) {} ll operator()(ll l, ll r) { uniform_int_distribution dist(l, r); return dist(mt); } } rng; int main(void) { cin.tie(0); ios::sync_with_stdio(0); const vector dx = {1, 0, -1, 0}; const vector dy = {0, 1, 0, -1}; int n, t; cin >> n >> t; vector a(n), b(n), c(n), d(n); rep(i, 0, n) { cin >> a[i] >> b[i] >> c[i] >> d[i]; a[i]--; b[i]--; c[i]--; d[i]--; } ll u = 1e6; int v = 1; rep(day, 0, t) { int ty = 0, x = -1, y = -1, z = -1, w = -1; if(day < 24) { ty = 2; } else { if(u >= 2000000 and day < t - 10) { ty = 1; x = rng(0, 13); y = rng(0, 13); while(!(0 <= z and z < 14 and 0 <= w and w < 14)) { int dir = rng(0, 3); z = x + dx[dir]; w = y + dy[dir]; } } else { ty = 3; } } if(ty == 1) { cout << ty << ' ' << x + 1 << ' ' << y + 1 << ' ' << z + 1 << ' ' << w + 1 << endl; } else { cout << ty << endl; } if(day < t - 1) { cin >> u >> v; } } }