#include <stdio.h>

int exp(int,int);
int main()
{
    int a,b,s;
    printf("Enter values for X and Y:");
    scanf("%d %d", &a,&b);
    s=exp(a,b);
    printf("%d",s);
    return 0;
}
int exp(int x, int y){
    int res=1,a=x,b=y;
    while(b!=0){
        if(b%2==0){
            a=a*a;
            b=b/2;
        }
        else
        {
            res=res*a;
            b=b-1;
        }
    }
    return res;
}
