program signals;

const
	MAXN					= 19;
	POW2N					= 524288; {288}

type
	Integer					= LongInt;

var
	used					: Array [0 .. POW2N] of Boolean;
	pow2					: Array [0 .. MAXN+1] of Integer;
	L					: Array [1 .. POW2N] of String[19];
	N, s					: Integer;
	fstr, s1, s2, s3			: String;
	f					: Text;
	k, i, j, dec1				: Integer;

function dec2bin(x, N: Integer): String;
var
	i					: Integer;
	t, s					: String;
begin
	t := '';
	for i := 1 to N do begin
		str(x mod 2, s);
		t := s + t;
		x := x div 2;
	end;
	dec2bin := t;
end;

function bin2dec(x: String): Integer;
var
	int					: Integer;
	code					: Word;
	r, i					: Integer;
begin
	r := 0;
	for i := 1 to N do begin
		val(x[i], int, code);
		r := r + (int * pow2[N-i]);
	end;
	bin2dec := r;
end;


begin
	readln(N);
	readln(fstr);
	for i := 0 to POW2N do 
		used[i] := False;
	pow2[0] := 1;
	for i := 1 to N+1 do
		pow2[i] := pow2[i-1] * 2;
	s := 0;
	for i := 0 to POW2[N]-1 do
		if (not used[i]) then begin
                	used[i] := True;
			s := s + 1;
			L[s] := dec2bin(i, N);
			s1 := L[s];
			for j := 1 to N do begin
				s2 := copy(s1, 1, j-1) + copy(s1, j+1, N);
				for k := 0 to (N-1) do begin
					s3 := copy(s2, 1, k) + '1' + copy(s2,k+1,N);
					dec1 := bin2dec(s3);
					used[dec1] := True;
					s3[k+1] := '0';
					dec1 := bin2dec(s3);
					used[dec1] := True;
				end; 
			end;
		end;
	assign(f, fstr);
	rewrite(f);
	writeln(f, s);
	for i := 1 to s do
		writeln(f, L[i]);
	close(f);
end.