# include <iostream>
using namespace std;
int main(){
    int month,day,sum;
    cin >> month >> day;
    while(month != 0){
        sum = 0;
        switch(month){
            case 1: sum = day; break;
            case 2: sum = 31+day; break;
            case 3: sum = 60+day; break;
            case 4: sum = 91+day; break;
            case 5: sum = 121 + day;break;
            case 6: sum = 152 + day;break;
            case 7: sum = 182 +day;break;
            case 8: sum = 213 + day;break;
            case 9: sum = 244 +day;break;
            case 10: sum = 274 +day;break;
            case 11: sum = 305 + day;break;
            case 12: sum = 335 +day;break;
            }
            sum %= 7;
        switch(sum){
            case 1: cout << "Thursday" << endl ;break;
            case 2: cout << "Friday" << endl ;break;
            case 3: cout << "Saturday" << endl ;break;
            case 4: cout << "Sunday" << endl ;break;
            case 5: cout << "Monday" << endl ;break;
            case 6: cout << "Tuesday" << endl ;break;
            case 0: cout << "Wednesday" << endl ;break;
        }
        cin >> month >> day;
        }
}

