#include "bits/stdc++.h"
#include "testlib.h"

using namespace std;

int main(int argc, char *argv[]) {
    registerGen(argc, argv, 1);

    int n = has_opt("n") ? opt<int>("n") : (int)2e5;
    int mn = has_opt("mn") ? opt<int>("mn") : 0;
    int mx = has_opt("mx") ? opt<int>("mx") : (int)1e6;

    println(n);
    
    for (int i = 1; i < n; ++i) {
        println(i + 1, rnd.next(1, i), rnd.next(mn, mx));
    }
    
    int nmx = 1;
    while (nmx < mx) nmx *= 2;
    int q = has_opt("q") ? opt<int>("q") : (int)2e5;
    println(q);
    while (q--) {
        println(rnd.next(0, nmx - 1));
    }
}
