#include <iostream>
using namespace std;

int main()
{
	int monthday[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	const char *weekday[7] = {"Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday"};
	
	int month, day;
	
	while(cin >> month >> day, month)
	{
		int w = day - 1;
		for(int i = 1; i < month; i++)
		    w += monthday[i];
		cout << weekday[w % 7] << endl;
	}
	return 0;
}