시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB114293185182.782%

문제

The factorial of $N$, written as $N!$, is defined as the product of all the integers from $1$ to $N$. For example, $3! = 1 \times 2 \times 3 = 6$.

This number can be very large, so instead of computing the entire product, just compute the last digit of $N!$ (when $N!$ is written in base $10$).

입력

The first line of input contains a positive integer $1 \leq T \leq 10$, the number of test cases. Each of the next $T$ lines contains a single positive integer $N$. $N$ is at most $10$.

출력

For each value of $N$, print the last digit of $N!$.

예제 입력 1

3
1
2
3

예제 출력 1

1
2
6

예제 입력 2

2
5
2

예제 출력 2

0
2