#include <bits/stdc++.h>
using namespace std;
int main(){
int a,b;
long long int x,d;
scanf("%d %d",&a,&b);
d=a;
for( int i=b;i>=1;i-- ){
d*=a;
}
x=d%7;
if(x==1) cout<<"Monday";
else if(x==2) cout<<"Tuesday";
else if(x==3) cout<<"Wednesday";
else if(x==4) cout<<"Thursday";
else if(x==5) cout<<"Friday";
else if(x==6) cout<<"Saturday";
else cout<<"Sunday";
return 0;
}