var
	i, j, k, n, m, r: longint;
	u: array [1..100] of boolean;
	l: array [1..100] of longint;
	q: array [1..100, 1..100] of longint;
begin
	randseed := 310239047;

	n := 10 + random(91);
	m := random(11);
	r := random(n) + 1;
	for i := 1 to m do begin
		l[i] := random(r) + 1;
		fillchar(u, sizeof(u), 0);
		for j := 1 to l[i] do begin
			repeat
				k := random(n) + 1;
			until not u[k];
			u[k] := true;
		end;
		l[i] := 0;
		for j := 1 to n do begin
			if (u[j]) then begin
				inc(l[i]);
				q[i][l[i]] := j;
			end;
		end;
	end;

	writeln(n, ' ', m);
	for i := 1 to m do begin
		write(l[i], ' ');
		for j := 1 to l[i] do begin
			write(' ', q[i][j]);
		end;
		writeln;
	end;
end.