//https://onlinejudge.u-aizu.ac.jp/problems/0027

#include <bits/stdc++.h>

using namespace std;

string day[7] = {"Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday"};
int months[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

int main() {
    int m, d;

    while (true) {
        cin >> m >> d;
        if (m + d == 0) return 0;

        m--;
        d--;
        for (int i = 0; i < m; ++i) {
            d += months[i];
        }
        cout << day[d % 7] << endl;
    }
}

/*
 * 1/1から何日ずれるか数えて7で割る。
 */
