#include<iostream>
#include<string>

int main()
{
	const char* StartOfYear = "Thursday";

	const char* Youbi[]=
	{
		"Sunday",
		"Monday",
		"Tuesday",
		"Wednesday",
		"Thursday",
		"Friday",
		"Sunday"
	};

	int NumYoubi = -1;

	for(size_t i=0; i<7; ++i)
	{
		if(Youbi[i]==StartOfYear)
		{
			NumYoubi = i;
		}
	}

	if(NumYoubi==-1)
	{
		std::cout << "Youbi set error!\n";

		exit(1);
	}

	const int dayMaxSum[13] = 
	{
		0,
		31,
		60,
		91,
		121,
		152,
		182,
		213,
		244,
		274,
		305,
		335,
		366
	};

	int month=1,day=0,daySum=0;//month=0で終了するため1で初期化

	while(std::cin >> month >> day && month!=0)
	{
		daySum = dayMaxSum[month-1]+day;

		std::cout << Youbi[(daySum-1+NumYoubi)%7];//daySum-1で周期があう 1/1…7で割ったあまりが0 NumYoubiで位相ズレ（1/1の曜日）を表す

		std::cout << '\n';

		daySum=0;
	}
}