#include<iostream>
using namespace std;

int main(void){

    string day[7] = {"Monday","tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};
    int month[12] = {31,29,31,30,31,30,31,31,30,31,30,31};
    int x,y;

    while(cin >> x >> y){
        if(x == 0 || y == 0){
            break;
        }


        for(int i = 0;i < x-1;i++){
            y += month[i];
        }

        cout << day[(y%7+2)%7] << endl;


        




    }


    return 0;
}