document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include<iostream>
  2. using namespace std;
  3. #include <math.h>
  4. int main()
  5. {
  6. long long int a,b;
  7. while(cin>>a>>b)
  8. {
  9. a%=10007;
  10. long long int ans = pow((long double)a,(long double)b);
  11. cout<<(ans%10007)<<endl;
  12. }
  13.  
  14. return 0;
  15. }
');