#include<iostream>
#include<string>

using namespace std;
 
int main(void){
	string week[7]={"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};
	int month[12]={31,29,31,30,31,30,31,31,30,31,30,31};
	int m,d,cnt,mc;
	
	while(cin>>m>>d){
		if(m==0){
			break;
		}
		mc=1;
		cnt=3;
		while(1){
			for(int i=1;i<=month[mc-1];i++,cnt++){
				if(m==mc && d==i){
					break;
				}
			}
			if(m==mc){
				break;
			}
			mc++;
		}
		cout<<week[cnt%7]<<endl;
	}
	return 0;
}