#include<stdio.h>
#include<math.h>
using namespace std;
int ww(int y, int m, int d){
if (m == 1 || m == 2) {
m += 12;
y--;
}
int iw = (d + 2 * m + 3 * (m + 1) / 5 + y + y / 4 - y / 100 + y / 400) % 7;
return iw + 1;
}
int main(){
int y, m, d;
while (scanf("%d%d%d", &y, &m, &d) != EOF){
int wk = ww(y, m, d);
//printf("%d\n", wk);
switch (wk){
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;
}