#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
using namespace std;
int main()
{
int y, m, d;
while(cin >> y >> m >> d){
if(m<3){
y = y - 1;
m = 12+m;
}
int c = y/100;
y = y%100;
int w;
w = y + int(y/4) + int(c/4) - 2*c + int((26*(m+1))/10) + d - 1;
if(w>=0){
w = w%7;
}else{
w = (w%7+7)%7;
}
switch(w){
case 0:cout << "Sunday" << endl;break;
case 1:cout << "Monday" << endl;break;
case 2:cout << "Tuesday" << endl;break;
case 3:cout << "Wednesday" << endl;break;
case 4:cout << "Thursday" << endl;break;
case 5:cout << "Friday" << endl;break;
default:cout << "Saturday" << endl;
}
}
return 0;
}