#include <iostream>
#include <string>

using namespace std;

int main()
{ 
	const string day[7] = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" };
	const int days[13] = { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30 };

	int month, date;

	while (cin >> month >> date, month)
	{
		int sum = 0;
		for (int i = 1; i < month; ++i)
			sum += days[i];

		sum += date;
		cout << day[sum % 7 + 2] << endl;
	}

	return 0;
}