The factorial of an integer , denoted as , is the product of all integers from to inclusive. Factorials grow rapidly: for example, is already too large to be stored in a -bit integer variable on most computers, and is too large for most floating-point variables. Your task is to find the rightmost non-zero digit of . For example, 5! = 1 \times 2 \times 3 \times 4 \times 5 = 120, so the rightmost non-zero digit for is . Also, 7! = 1 \times 2 \times 3 \times 4 \times 5 \times 6 \times 7 = 5040, so for the answer is .
The first line contains the number of test cases (T < 15). Each following line contains a single test case with an integer , where 1 \leq n \leq 1000.
For each test case, output the rightmost non-zero digit of .
Example 1