#include <bits/stdc++.h>
using namespace std;

using pii = pair<int, int>;
using ll = long long;

int main() {
    int m, d;
    constexpr int day[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    const string ans[7] = {"Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday"};
    while(cin >> m >> d, m) {
        int x = 0;
        for(int i = 1; i <= 12; ++i) {
            if(m == i) {
                cout << ans[(x + d - 1) % 7] << endl;
                break;
            } else {
                x = (x + day[i]) % 7;
            }
        }
    }
}
