program put;
var n,ans:longint;
function cuo(k:longint):longint;
var i:longint;
begin
if k=1 then begin
cuo:=0;
exit;
end;
if odd(k) then i:=-1 else i:=1;
cuo:=(k*cuo(k-1)+i)mod 1206;
end;
begin
assign(input,'put.in');
assign(output,'put.out');
reset(input);
rewrite(output);
read(n);
if n=1 then begin
write('No Solution!');
close(input);
close(output);
halt;
end;
ans:=cuo(n);
write(ans);
close(input);
close(output);
end.