#include<stdio.h>
int main(void)
{
	int y,m,d;
	int i;
	int ans;
	
	y=2004;
	
	for(;;)
	{
		scanf("%d%d",&m,&d);
		if(m==0 && d==0)
			break;
		
		ans=0;
		
		ans=(y-1)*365+y/4-y/100+y/400;
		
		for(i=1;i<m;i++)
		{
			if(i==2 && (y/4==0 && y/100!=0) || y/400==0)
				ans+=29;
			else if(i==2)
				ans+=28;
			else if(i<8 && i%2==0)
				ans+=30;
			else if(i<8 && i%2!=0)
				ans+=31;
			else if(i>7 && i%2==0)
				ans+=30;
			else
				ans+=31;
		}
		
		ans+=d;
		
		if(m<3 && ((y%4==0 && y%100!=0) || y%400==0))
			ans-=1;
		
		switch(ans%7)
		{
			
			case 0:
				printf("Sunday\n");
				break;
			case 1:
				printf("Monday\n");
				break;
			case 2:
				printf("Tuesday\n");
				break;
			case 3:
				printf("Wednesday\n");
				break;
			case 4:
				printf("Thursday\n");
				break;
			case 5:
				printf("Friday\n");
				break;
			case 6:
				printf("Saturday\n");
				break;
		}
	}
		
	return 0;
}