#include "testlib.h"
#include <iostream>
#include <string>
#include <set>
#include <map>
#include <vector>

using namespace std;

int main(int argc, char* argv[])
{
	registerGen(argc, argv, 1);
	
	
	int N = 10000;
	int M = 10000;
	cout << N << " " << M << endl;
	
	int center_v = rnd.next(2, N);
	vector<int> crosses(M, 0);
	
	for(int i = 0;i < M; ++i)
	{
	    crosses[i] = i + 1;
	}
	shuffle(crosses.begin(), crosses.end());
	
	for(int i = 0; i < M; ++i)
	{
	    vector<int> cur;
	    int K = 100;
	    int tmp = 0;
	    for(int j = 0; j < K; ++j) 
	    {
	        if (j == 0) tmp = 1;
	        else if (j % 2) tmp = center_v;
	        else
	        {
	            tmp = crosses[i];
	        }
	        cur.push_back(tmp);
	    }
	    cout << cur.size() << " ";
	    for(int j = 0; j < cur.size(); ++j) 
	    {
	        cout << cur[j];
	        if (j != cur.size() - 1) cout << " ";
	    }
	    cout << endl;
	}
	
	return 0;
}