Factorial assignment program