#include <stdio.h>
int main()
{
int y, m, d, c, w;
while(scanf ("%d %d %d", &y, &m, &d)!=EOF){
if (m ==1 || m == 2)
{
y--;
m += 12;
}
c = y / 100;
y = y - c * 100;
w = (c / 4) - 2 * c + (y + y / 4) + (13 * (m + 1) / 5) + d - 1;
while (w < 0) w += 7;
w %= 7;
if (w == 0)
printf ("Sunday\n");
else
{
switch(w)
{
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;
case 7:
printf("Sunday\n");
break;
}
}
}
return 0;
}