#include <iostream>
#include <string>
using namespace std;
void Next_Day(int& year, int& month, int& day) {
int dayofmonth[] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
if (year % 400 == 0 || year % 4 == 0 && year % 100 != 0) {
dayofmonth[2] = 29;
}
else {
dayofmonth[2] = 28;
}
if (day >= dayofmonth[month]) {
day = 1;
if (month == 12) {
year++;
month = 1;
}
else {
month++;
}
}
else {
day++;
}
}
int main() {
string s[] = { "Thursday","Friday","Saturday","Sunday","Monday","Tuesday","Wednesday" };
int m, d;
cin >> m >> d;
int cnt = 1;
int cy = 2012, cm = 4, cd = 12;
while (1)
{
if (cm == m && cd == d)
{
break;
}
else
{
Next_Day(cy, cm, cd);
cnt++;
}
}
cout << s[(cnt - 1) % 7]; //注意string和printf不兼容,故用cout
return 0;
}