#include <bits/stdc++.h>
#include "testlib.h"
 
using namespace std;

int main(int argc, char** argv) {
    registerGen(argc, argv, 1);
	int t = opt<int>("t");
	int minn = opt<int>("minn");
    int maxn = opt<int>("maxn");
    int mink = opt<int>("mink");
    int maxk = opt<int>("maxk");
    
    cout << t << "\n";

	for (int i = 0; i < t; ++i) {
		int n = rnd.next(minn, maxn);
		int k = rnd.next(mink, maxk);
		if (mink <= 2 && rnd.next() < 0.01) {
			k = 2;
		}
		cout << n << " 0 " << k << "\n";
	}
    return 0;
}