Little Gaurav is very fond of numbers and sequences. One day his teacher tells him to find a strange sequence.
Since this sequence looks a bit difficult, the teacher tells him to find the last digit of .
Little Gaurav is confused because he cannot solve the problem and leaves this problem to the worthy programmers of the world. Help little Gaurav in finding the solution.
The first line contains , the number of test cases.
lines follow, each line containing an integer, .
For each testcase, print the last digit of in one line.
For n=1, only i=0 is valid. So S is . Hence last digit of S is 0.
For n=2, only i=0 and 1 are valid. So S is
S1(for i=0) is .
S2(for i=1) is .
So last digit of S is 6.