Let's play a game. I will give you a number . You will have to tell me . Okay, it may seem difficult for you to calculate this huge number. So tell me the last digit of . In other words: .
The first line will contain (), which indicates test cases.
Next lines will each contain a number ().
For each cases, print .
Input | Output |
---|---|
6 1 2 3 4 5 6 | 1 4 9 6 5 6 |
When , . When , . When , . When , . When , . When , . |