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

string day[7] = {"Saturday", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"};

int main(){
    int m, d;
    while(cin >> m >> d, m != 0){
        int y = 2004;
        if(m == 1 || m == 2){
            y--;
            m += 12;
        }
        int h = (d + 26*(m+1)/10 + (y%100) + ((y%100)/4) + 5*(y/100) + (y/100)/4) % 7;
        cout << day[h] << endl;
    }

    return 0;
}
