Help Odin Again!

0

0 votes
Problem

PROBLEM

After solving many questions on different platforms Aris now became a good programmer but still he is stuck in a mathematical problem and Again Odin has to help him.

Odin has to find power(2,power(a,b)) % 1000000007(1e9 + 7) . Where power(n,m) means n^m. Help Odin in writing the code.

INPUT

The first line of input is a single integer T denoting the number of test-cases.

Each of the following T test-cases contains two integers a and b.


OUTPUT

Your program should print T lines containing answers to each test case.

CONSTRAINTS

1<=T<=100
1<= a <= 1010^6
1<= b <=1e18

Sample Input
3
5 1
5 2
123456789987654321123 2
Sample Output
32
33554432
334323169
Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?