Leftmost Digit
Given a positive integer N, you should output the leftmost digit of N^N.
Input
The input contains several test cases. The firstlineofthe input is a single integer T which is thenumberof test cases. T test cases follow.
Each test casecontainsa single positive integer N(1<=N<=1,000,000,000).
Output
For each test case, you should output the leftmost digit of N^N.
Sample Input
234
Sample Output
22