#include<stdio.h>
#include<string>
using namespace std;
int week(int x){
	x++;
	if(x==8)return 1;
	else return x;}
int main(){
	int d[13][32];
	int i,j,k=4;
	for(i=1;i<13;i++){
		if(i==1||i==3||i==5||i==7||i==8||i==10||i==12){
			for(j=1;j<32;j++){
				d[i][j]=k;
				k=week(k);}}
		if(i==2){
			for(j=1;j<30;j++){
				d[i][j]=k;
				k=week(k);}}
		if(i==4||i==6||i==9||i==11){
			for(j=1;j<31;j++){
				d[i][j]=k;
				k=week(k);}}}
	string day[8]={" ","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};
	int m,n;
	while(1){
		scanf("%d %d",&m,&n);
		if(m==0&&n==0)break;
		switch(d[m][n]){
			case 1:printf("Monday");break;
			case 2:printf("Tuesday");break;
			case 3:printf("Wednesday");break;
			case 4:printf("Thursday");break;
			case 5:printf("Friday");break;
			case 6:printf("Saturday");break;
			case 7:printf("Sunday");break;}
	printf("\n");}
	return 0;}
