function factorial(num: integer): integer;
var i, fac: integer;
begin
fac:= 1;
for i:= 2 to num do fac:= fac * i;
factorial:= fac;
end;
procedure print_sumof9(a, b, c, d, e, f, g, h, i: integer);
writeln(a + b + c + d + e + f + g + h + i);
print_sumof9(factorial(1), factorial(2), factorial(3), factorial(4), factorial(5), factorial(6), factorial(7), factorial(8), factorial(9))
end.
function factorial(num: integer): integer;
var i, fac: integer;
begin
fac:= 1;
for i:= 2 to num do fac:= fac * i;
factorial:= fac;
end;
procedure print_sumof9(a, b, c, d, e, f, g, h, i: integer);
begin
writeln(a + b + c + d + e + f + g + h + i);
end;
begin
print_sumof9(factorial(1), factorial(2), factorial(3), factorial(4), factorial(5), factorial(6), factorial(7), factorial(8), factorial(9))
end.