Element integer_multiplication = ?primitives/integer_multiplication
Element integer_lte = ?primitives/integer_lte
Element integer_subtraction = ?primitives/integer_subtraction

include "io.alh"

Integer function factorial(n : Integer):
	if(integer_lte(n, 1)):
		return 1!
	else:
		return integer_multiplication(n, factorial(integer_subtraction(n, 1)))!

Void function main():
	while(True):
		output(factorial(input()))
