The factorial of the integer $n$, written $n!$, is defined as:   

$n!=n\times(n-1)\times(n-2)\times\text{}\cdots\times3\times2\times1$

Calculate and print the factorial of a given integer.  

For example, if $n=30$, we calculate $30\times29\times28\times\text{...}\times2\times1$ and get $265252859812191058636308480000000$.

Function Description

Complete the extraLongFactorials function in the editor below.  It should print the result and return.  

extraLongFactorials has the following parameter(s):  

n: an integer

Note: Factorials of $n>20$ can't be stored even in a $64-bit$ long long variable. Big integers must be used for such calculations. Languages like Java, Python, Ruby etc. can handle big integers, but we need to write additional code in C/C++ to handle huge values.  

We recommend solving this challenge using BigIntegers.  

Input Format

Input consists of a single integer $n$

Constraints

$1\leq n\leq100$

Output Format

Print the factorial of $n$. 

Sample Input

$25$

Sample Output

$1551121004330985984000000$

Explanation

$25!=25\times24\times23\times\text{...}\times3\times2\times1$

Source: hackerrank | Difficulty: MEDIUM
Tags: Implementation


Solutions:
from math import factorial
print(factorial(int(input())))


from math import factorial
print(factorial(int(input())))


from math import factorial
print(factorial(int(input())))


import math
import fileinput
input_list = []
for line in fileinput.input():
	input_list.append(int(line))
print(math.factorial(input_list[0]))


n = int(input())
x = 1
for m in range(1, n + 1):
	x = x * m
print(x)


f = lambda x: int(x < 2) or x * f(x - 1)
print(f(int(input())))


import sys

def fact(j):
	if j == 1:
		return j
	return fact(j - 1) * j
i = int(sys.stdin.readline())
print(fact(i))


def factorial(n):
	if n == 0:
		return 1
	else:
		return n * factorial(n - 1)
print(factorial(int(input())))


n = int(input())
if n == 1:
	print(1)
else:
	nFactorial = 2
	n = n + 1
	for i in range(3, n):
		nFactorial = nFactorial * i
	print(nFactorial)


n = int(input())
total = n
for index in range(2, n):
	total *= index
print(total)


n = int(input())
f = 1
for i in range(1, n + 1):
	f *= i
print(f)


def factorial(x):
	if x == 0:
		return 0
	answer = 1
	while x > 0:
		answer *= x
		x = x - 1
	return answer
num = int(input())
print(factorial(num))


N = int(input())
pro = 1
for i in range(1, N + 1):
	pro *= i
print(pro)


from math import factorial as f
n = int(input())
print(f(n))


import math
n = int(input())
print(math.factorial(n))


import math
n = int(input())
print(math.factorial(n))


a = int(input())
b = a
while a > 1:
	b = b * (a - 1)
	a = a - 1
print(b)


def factorial(n):
	if n == 0:
		return 1
	temp = n * factorial(n - 1)
	return temp
range = int(input())
print(factorial(range))


def factorial(n):
	if n == 0:
		return 1
	else:
		return n * factorial(n - 1)
num = int(input())
print(factorial(num))


n = int(input())
s = 1
while n > 1:
	s = n * s
	n -= 1
print(s)


def factor(n):
	if n == 0:
		return 1
	else:
		return n * factor(n - 1)
N = int(input())
print(factor(N))


n = int(input())
i = 2
ans = 1
while i <= n:
	ans *= i
	i += 1
print(ans)


from math import factorial
n = int(input())
print(factorial(n))


def fact(n):
	if n == 1:
		return 1
	else:
		return n * fact(n - 1)
N = int(input())
print(fact(N))


N = input()
N = int(N)
A = 1
B = 1
while B <= N:
	A = A * B
	B += 1
print(A)


n = int(input())
product = 1
for mult in range(1, n + 1):
	product = mult * product
print(product)


size = int(input())
res = 1
for i in range(1, size + 1):
	res *= i
print(res)


nummer = int(input())
teller = nummer
while nummer > 1:
	teller = teller * (nummer - 1)
	nummer -= 1
print(teller)


N = input()
N = int(N)
ans = 1
for i in range(1, N + 1):
	ans *= i
print(ans)


n = int(input())
sumw = 1
for i in range(1, n + 1):
	sumw = sumw * i
print(sumw)


n = int(input())
r = 1
for i in range(1, n + 1):
	r *= i
print(r)


def f(n):
	p = 1
	for i in range(2, n + 1):
		p *= i
	return p
n = int(input())
print(str(f(n)))


number = int(input())
total = 1
for i in range(0, number):
	total *= number - i
print(total)


import math
print(math.factorial(int(input())))


n = int(input())
r = n
for i in range(1, n):
	r *= i
print(r)


n = int(input())
sum1 = 1
for x in range(0, n):
	sum1 = sum1 * (n - x)
print(sum1)


import math
print(math.factorial(int(input())))


import math
print(math.factorial(int(input())))


a = int(input())
answer = 1
for x in range(1, a + 1):
	answer *= x
print(answer)


n = int(input())
sum = 1
for i in range(0, n):
	sum = sum * (n - i)
print(sum)


import math
print(math.factorial(int(input())))


num = int(input())
factorial = 1
if num == 0:
	print('1')
else:
	for i in range(1, num + 1):
		factorial = factorial * i
	print(factorial)


def factorial(n):
	if n == 1:
		return 1
	else:
		return n * factorial(n - 1)
num = int(input())
print(factorial(num))


n = int(input())
fact = 1
while n:
	fact *= n
	n -= 1
print(fact)


n = int(input())
fac = 1
for i in range(2, n + 1):
	fac = i * fac
print(fac)


def facto(n):
	if n < 3:
		return n
	else:
		return n * facto(n - 1)
print(facto(int(input())))


import math
print(math.factorial(int(input())))


N = int(input())
factorial = 1
for i in range(2, N + 1):
	factorial *= i
print(factorial)


from math import factorial
print(factorial(int(input())))


from math import factorial
print(factorial(int(input())))


import math

def longfact(n):
	return math.factorial(n)
n = int(input())
print(longfact(n))


import math
n = int(input())
print(math.factorial(n))


def fact(n):
	if n < 2:
		return 1
	else:
		f = 1
		for i in range(2, n + 1):
			f *= i
		return f
n = int(input().strip())
print(fact(n))


N = int(input())
result = 1
for i in range(2, N + 1):
	result = result * i
print(result)


prod = 1
n = int(input())
for i in range(1, n + 1):
	prod *= i
print(prod)


import sys

def factorial(x):
	y = x
	while x > 1:
		x -= 1
		y *= x
	return y
for input in sys.stdin:
	x = int(input)
	print(factorial(x))


n = int(input())
z = 1
for i in range(1, n + 1):
	z *= i
print(z)


N = int(input())
f = 1
for i in range(1, N + 1):
	f *= i
print(f)


n = int(input())
k = 1
for i in range(1, n + 1):
	k = k * i
print(k)


n = int(input())
p = 1
for i in range(1, 1 + n):
	p = p * i
print(p)


def f(n):
	if n:
		return n * f(n - 1)
	else:
		return 1
print(f(int(input())))


N = int(input())
x = 1
for i in range(1, N + 1):
	x *= i
print(x)


n = int(input())
result = 1
for i in range(1, n + 1):
	result *= i
print(result)


n = int(input())
prod = 1
while n > 1:
	prod = prod * n
	n = n - 1
print(prod)


n = int(input())
a = 1
for i in range(2, n + 1):
	a *= i
print(a)


n = int(input())
factorial = 1
for i in range(1, n + 1):
	factorial *= i
print(factorial)


n = int(input())
fact = 1
while n:
	fact = fact * n
	n -= 1
print(fact)


n = int(input())
from math import factorial as f
print(f(n))


import math
n = int(input())
print(math.factorial(n))


entrada = int(input())
i = 0
factorial = 1
while i < entrada:
	factorial = factorial * (entrada - i)
	i += 1
print(factorial)


p = 1
for i in range(1, int(input()) + 1):
	p *= i
print(p)


import math, sys
N = int(sys.stdin.readline())
print(math.factorial(N))


num = int(input())
factorial = 1
for i in range(1, num + 1):
	factorial = factorial * i
print(factorial)


from math import factorial
import sys
in_ = int(sys.stdin.read())
print(factorial(in_))


from math import factorial
N = input()
print(factorial(int(N)))


num = int(input())
for x in range(1, num):
	num = num * x
print(num)


import math
case = int(input())
print(math.factorial(case))


a = int(input())
tmp = a - 1
while tmp:
	a = a * tmp
	tmp = tmp - 1
print(a)


n = int(input())
val = 1
for i in range(1, n + 1):
	val *= i
print(val)


n = int(input())
fac = 1
for i in range(2, n + 1):
	fac *= i
print(fac)


import sys

def factorial(number):
	if number == 1:
		return 1
	else:
		return factorial(number - 1) * number
number = int(sys.stdin.readline())
print(factorial(number))


import math
print(math.factorial(int(input())))


N = int(input())
f = 1
for i in range(1, N + 1):
	f *= i
print(f)


n = int(input())
res = 1
for i in range(n):
	res *= i + 1
print(res)


import math
n = int(input())
print(math.factorial(n))


n = int(input())
f = 1
for x in range(1, n + 1):
	f *= x
print(f)


def main():
	n = int(input())
	val = 1
	for i in range(1, n + 1):
		val = val * i
	print(val)
main()


from math import factorial
N = int(input())
print(factorial(N))


n = int(input())
prod = 1
for i in range(1, n + 1):
	prod *= i
print(prod)


import math
print(math.factorial(int(input())))


num = int(input())
factorial = 1
for i in list(range(num)):
	factorial *= i + 1
print(factorial)


def factorial(number):
	if number == 1:
		return 1
	return number * factorial(number - 1)
number = int(input())
factorialResult = factorial(number)
print(factorialResult)


import math
factor = int(input())
print(math.factorial(factor))


def factorial(n):
	if n == 0:
		return 1
	else:
		n = n * factorial(n - 1)
		return n
n = int(input())
print(factorial(n))


n = eval(input())
f = 1
for i in range(2, n + 1):
	f *= i
print(f)


n = int(input())
f = 1
for i in range(n, 0, -1):
	f *= i
print(f)


def factorial(n):
	if n == 1:
		return 1
	return n * factorial(n - 1)
n = int(input().strip())
print(factorial(n))


import math
n = int(input())
print(math.factorial(n))


import math
N = int(input().strip())
print(math.factorial(N))