var
	n, m, i: longint;
	a: array [1..100] of longint;
begin
	randseed := 203902347;

	n := random(31);
	m := 1 + random(30);

	for i := 1 to n do begin
		if random(2) = 0 then
			a[i] := 1 shl random(30)
		else
			a[i] := random(1000000000);
	end;

	writeln(n, ' ', m);
	for i := 1 to n do begin
		write(a[i]);
		if (i < n) then
			write(' ');
	end;
	writeln;
end.