#include <iostream>
#include <map>
using namespace std;
const int N = 21;
map<string, int> idm= { // m2i
{"January", 1},
{"February", 2},
{"March", 3},
{"April", 4},
{"May", 5},
{"June", 6},
{"July", 7},
{"August", 8},
{"September", 9},
{"October", 10},
{"November", 11},
{"December", 12}
};
const string week_of[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
const int dys_of[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main() {
int d, y; string m;
while (cin >> d >> m >> y) {
int k = 0; // 第k天
for (int i = 1; i <= y-1; i++) {
if (i % 400 == 0 || i % 100 != 0 && i % 4 == 0) k += 366;
else k += 365;
}
for (int i = 1; i <= idm[m]-1; i++) {
k += dys_of[i-1];
if (i == 2 &&
(y % 400 == 0 || y % 100 != 0 && y % 4 == 0)) k++;
}
k += d;
cout << week_of[k % 7] << endl;
}
return 0;
}