beecrowd | 2217

Nove

By Pedro Michael, IFCE BR Brazil

Timelimit: 1

Paulo Bruno is a boy that like Pokemons, whoever he hates math, he hates exponentiation and for some reason he doesn't calculate correctly operations with the number 9. Knowing about that, his friend Werlesson decided to do a challenge for Paulo. Werlesson wants Paulo calculates the N-th power of 9 and answer the last digit of that. For example: given N=2, the answer should be 1, because 92=81. The difficulty is that 9N for a big N is a very very huge number. Without ideas, Paulo decided ask for your help.

Input

The input consists of many instances of the problem. The first line contains just an integer T that represents the number of instances.

Each instance is composed by one line that has an integer number N(0 ≤ N ≤ 109).

Output

For each instance in the input, your must print a line with the last digit of 9N.

Input Samples Output Samples

2
1
2

9
1