const
	maxn = 50;
	maxk = 10;

var
	n, k, i, j: longint;
	a: array [1..maxn] of longint;
	cc: array [0..maxn] of longint;
	p: array [1..2 * maxk] of longint;
	u: array [-maxk..maxk] of boolean;
	fact: array [0..2 * maxk] of longint;
	s: array [1..2 * maxn] of longint;
	sp: longint;

procedure genperm(l: longint);
var
	i: longint;
begin
	if l > 2 * k then begin
		writeln(n, ' ', k);
		for i := 1 to 2 * k do begin
			write(p[i]);
			if (i < 2 * k) then
				write(' ');
		end;
		writeln;
		for i := 1 to 2 * n do begin
			write(a[i]);
			if (i < 2 * n) then
				write(' ');
		end;
		writeln;
		exit;
	end;

	for i := -k to k do begin
		if not u[i] then begin
			u[i] := true;
			p[l] := i;
			genperm(l + 1);
			u[i] := false;
		end;
	end;
end;

procedure generate(i, j: longint);
var
	p: longint;
begin
	if i > 2 * n then begin
		u[0] := true;
		genperm(1);
		exit;
	end;

	if 2 * n - i >= j + 1 then begin
		a[i] := 1;
		inc(sp);
		s[sp] := -1;
		generate(i + 1, j + 1);
		dec(sp);

		a[i] := 2;
		inc(sp);
		s[sp] := -2;
		generate(i + 1, j + 1);
		dec(sp);
	end;
	if (j > 0) then begin
		a[i] := s[sp];
		dec(sp);
		generate(i + 1, j - 1);
		inc(sp);
		s[sp] := a[i];
	end
end;

begin
	n := 4;
	k := 2;
	cc[0] := 1;
	for i := 1 to n do begin
		for j := 0 to i - 1 do begin
			cc[i] := cc[i] + cc[j] * cc[i - j - 1];
		end;
	end;
	fact[0] := 1;
	for i := 1 to 2 * k do begin
		fact[i] := fact[i - 1] * i;
	end;

	writeln(fact[2 * k] * (1 shl n) * cc[n]);
	sp := 0;

	generate(1, 0);
end.