#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
#include <stack>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
using namespace std;

int main(){
    int m, d;
    while (cin>>m>>d){
        if (m == 0) break;
        int dow = 3, num[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
        vector<string> str;
        str.push_back("Monday");
        str.push_back("Tuesday");
        str.push_back("Wednesday");
        str.push_back("Thursday");
        str.push_back("Friday");
        str.push_back("Saturday");
        str.push_back("Sunday");

        int sum = 0;
        for (int i=0; i < m-1; i++)
            sum += num[i];
        sum += d+2;
        cout << str[sum%7] << endl;
    }
}
