#include<stdio.h>
#include<math.h>
int main(){
int y,m,d,a,b,c;
while (scanf("%d%d%d",&y,&m,&d)!=EOF){
if((m==1)||(m==2)){
m=m+12;
y=y-1;
}
a=y/100;
y=y%100;
b=a/4-2*a+y+y/4+(13*(m+1)/5)+d-1;
c=(b+70000)%7;
switch(c){
case 0:printf("Sunday\n");
break;
case 1:printf("Monday\n");
break;
case 2:printf("Tuesday\n");
break;
case 3:printf("Wednesday\n");
break;
case 4:printf("Thursday\n");
break;
case 5:printf("Friday\n");
break;
case 6:printf("Saturday\n");
break;
}
}
return 0;
}