#include <bits/stdc++.h>

using namespace std;

int zeller(int Y, int M, int D)
{
    if (M < 3) {
	Y--;
	M += 12;
    }
    return (Y+Y/4-Y/100+Y/400+(13*M+8)/5+D)%7;
}

int main()
{
    const string w[] = {
        "Sunday",
        "Monday",
        "Tuesday",
        "Wednesday",
        "Thursday",
        "Friday",
        "Saturday",
        "Sunday"
    };
        
    int M, D;
    while (cin >> M >> D, M) {
        cout << w[zeller(2004, M, D)] << endl;
    }
    return 0;
}