#include <iostream>
#include <vector>
#include <algorithm>

#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif

int main(int argc, char **argv){
	int m, d;
	std::vector<int> num_date_month;

	num_date_month.push_back(0);
	num_date_month.push_back(31); //31
	num_date_month.push_back(60); //29
	num_date_month.push_back(91); //31
	num_date_month.push_back(121); //30
	num_date_month.push_back(152); //31
	num_date_month.push_back(182); //30
	num_date_month.push_back(213); //31
	num_date_month.push_back(244); //31
	num_date_month.push_back(274); //30
	num_date_month.push_back(305); //31
	num_date_month.push_back(335); //30

#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
	//FILE *fp = fopen("test.txt", "r");
#endif

#if INPUT_FROM_FILE
	while(ifs >> m >> d){
#else
	while(std::cin >> m >> d){
#endif
		if(m == 0 && d == 0){
			break;
		}
		int num_date = num_date_month[m - 1] + d - 1;
		int day = num_date % 7;

		switch(day){
		case 0:
			std::cout << "Thursday" << std::endl;
			break;
		case 1:
			std::cout << "Friday" << std::endl;
			break;
		case 2:
			std::cout << "Saturday" << std::endl;
			break;
		case 3:
			std::cout << "Sunday" << std::endl;
			break;
		case 4:
			std::cout << "Monday" << std::endl;
			break;
		case 5:
			std::cout << "Tuesday" << std::endl;
			break;
		case 6:
			std::cout << "Wednesday" << std::endl;
			break;
		default:
			break;
		}

	}

	
	return 0;
}
