Given 6 numbers a,b,c,d,e,f. Find the last digit of (a^b)*(c^d)*(e^f).
The first line of the test case contains an integer T, denoting number of test cases. Following T lines contains six space separated integers a, b, c, d, e and f.
For each of the test case print the required answer in separate lines.
3 66 6 41 7 53
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.