1083
#include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { int a,b; cin>>a>>b; int c=1; for(int i=0;i<b;i++){ c=c*a; } if(c%7==0){ cout<<"Sunday"; }else if(c%7==1){ cout<<"Monday"; }else if(c%7==2){ cout<<"Tuesday"; }else if(c%7==3){ cout<<"Wednesday"; }else if(c%7==4){ cout<<"Thursday"; }else if(c%7==5){ cout<<"Friday"; }else if(c%7==6){ cout<<"Sunday"; } return 0; }