uses
	SysUtils;

const
	maxn = 100000;
var
	i, n, c: longint;
	a: array [1..maxn] of longint;
begin
	n := strtoint(paramstr(1));
	c := strtoint(paramstr(2));
	randseed := n * 31 + c;

	for i := 1 to n do begin
		a[i] := random(c) + 1;
	end;

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