#include <stdio.h>
int power(int *b,int *e){
    int res=1;
    while(*e!=0){
         res*=*b;
        *(e)--;
    }
    printf("%d\n",res);
} 
int main(){
    int t;
    scanf("%d",&t);
    if(t<0){
        printf("Invalid Input");
        return 0;
    }
    while(t!=0){
        int b,e;
        scanf("%d %d",&b,&e);
       
        printf("%d\n",ans);
        power(&b,&e);
        t--;
    }
}