#include<iostream>
#include<string>
using namespace std;
int main() {
    int m, d, w, days[] = {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335};
    string wdays[] = {"Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday"};
    while(cin >> m >> d) {
        if(m || d) {
            cout << wdays[(days[m - 1] + d - 1) % 7] << endl;
        }
    }
}

