#include <bits/stdc++.h>
using namespace std;
mt19937_64 rnd((random_device())());
int a[400010];
void rmain(int n) {
    int m = 400000, k = 2 * n - 1;
    printf("%d %d %d\n", n, m, k);
    for (int i = 1; i <= m / 2; i++) a[i] = a[i + m / 2] = rnd() % k + 1;
    shuffle(a + 1, a + 1 + m, rnd);
    for (int i = 1; i <= m; i++) printf("%d%c", a[i], " \n"[i == m]);
}
int main() {
    int T = 5;
    printf("%d\n", T);
    rmain(300);
    rmain(2);
    rmain(4);
    rmain(3);
    rmain(7);
}