LSTDGT  Last Digit of Power
Given two numbers a and b. Find the last digit of a^b. (a to the power b)
Input
There will be t (1<=t<=10) testcases. In each case there will be two number a (1<=a<=10^100000) and b (1<=b<=10^100000) separated by a space.
Output
Print the last digit of a^b in a single line.
Sample Input:
2
3 10
6 2
2
3 10
6 2
Sample Output:
9
6
hide comments
ssunitk:
20170601 21:28:27
well quite easy one...


Francky:
20170601 19:39:55
To be moved to tutorial very soon ! 

[Lakshman]:
20170601 16:46:02
@Jamil Siam: Changing time limit is not an good idea after you publish the Problem. We have all ready many problem slimier to this. 

Jamil Siam:
20170601 16:32:08
@all: TL has been updated. Please try again. Last edit: 20170601 16:33:46 

[Lakshman]:
20170601 09:19:29
Please move this to tutorials ASAP. 

yash_18:
20170531 16:03:51
Last edit: 20170531 21:29:54 
Added by:  Jamil Siam 
Date:  20170531 
Time limit:  0.100s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All 