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