#include <stdio.h>
#include <bits/stdc++.h>

using namespace std;

bool _u;

namespace AK {

typedef long long ll;
typedef double db;

#define rep(i, l, r) for(int i = l, i##end = r; i <= i##end; ++ i)
#define per(i, l, r) for(int i = l, i##end = r; i >= i##end; -- i)

template <class T>
inline void chmax(T &x,const T &y) {
	if(x < y) x = y;
}

template <class T>
inline void chmin(T &x, const T &y) {
	if(y < x) x = y;
}

inline int read() {
	int res = 0; char ch = getchar(); bool f = 1;
	for(; ch < '0' || ch > '9'; ch = getchar())
		if(ch == '-') f = 0;
	for(; ch >= '0' && ch <= '9'; ch = getchar())
		res = res * 10 + ch - '0';
	return f ? res : -res;
}
mt19937 rng(time(0));

void Main() {
	int n = 1000, q = 10000;
	printf("%d %d\n", n, q);
	rep(i, 1, q) {
		int opt = rng() % 3 + 1;
		if(opt == 2) puts("2");
		else {
			int l = rng() % n + 1, r = rng() % n + 1;
			if(l > r) swap(l, r);
			if(opt == 1) printf("1 %d %d\n", l, r);
			else printf("3 %d %d %d %d\n", l, r, rng() % 50 + 1, rng() % 50 + 1);
		}
	}
}

}

bool _v;

signed main() {
	//freopen("plant.in", "r", stdin);
	freopen("test.in", "w", stdout);
	clock_t st = clock();
	AK :: Main();
	cerr << "time = " << (clock() - st) * 1.0 / CLOCKS_PER_SEC << endl;
	cerr << "space = " << (&_u - &_v) / 1048576.0 << endl;
	return 0;
}
