#include<stdio.h>
int main(){
int a,b,c;
char *w[7]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};
while(scanf("%d%d%d",&a,&b,&c)!=EOF){
if(b<3){
b+=12;
a--;
}
printf("%s\n",w[(c+1+2*b+3*(b+1)/5+a+a/4-a/100+a/400)%7]);
}
return 0;
}