//Pascal
var
a, p: word;
i, n: integer;
begin
readln(n);
//цикл for
p := 1;
for i := 1 to n do
p := p * i;
writeln(p);
//цикл while
i := 1;
p := 1;
while i <= n do <br> begin
p := p * i;
i := i + 1;
end;
writeln(p);
//цикл repeat
i := 1;
p := 1;
repeat
p := p * i;
i := i + 1;
until i > n;
writeln(p);
end.