#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;

int day_of_week(int y,int m,int d){
	static int t[]={0,3,2,5,0,3,5,1,4,6,2,4};
	y-=m < 3;
	return ( y + y/4 - y/100 + y/400 + t[m-1] + d) % 7 ;
}

int main(){
	int m , d , w=4 , fw;
	while (cin >> m >> d, m){
		switch(day_of_week(2004,m,d)){
			case 0:
			cout << "Sunday" << endl;
			break;
			case 1:
			cout << "Monday" << endl;
			break;
			case 2:
			cout << "Tuesday" << endl;
			break;
			case 3:
			cout << "Wednesday" << endl;
			break;
			case 4:
			cout << "Thursday" << endl;
			break;
			case 5:
			cout << "Friday" << endl;
			break;
			case 6:
			cout << "Saturday" << endl;
		}
	}
	return 0; 
}
#include <stdio.h>

int main(void)
{
	int day[13][32];
	int i, j;
	int n = 4;
	int month;
	int da;
	
	for (i = 1; i <= 12; i++){
		 if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12){
			for (j = 1; j <= 31; j++){
				day[i][j] = n;
				n++;
				if (n == 8){
					n = 1;
				}
			}
		}
		else if (i == 4 || i == 6 || i == 9 || i == 11){
			for (j = 1; j <= 30; j++){
				day[i][j] = n;
				n++;
				if (n == 8){
					n = 1;
				}
			}
		}
		else if (i == 2){
			for (j = 1; j <= 29; j++){
				day[i][j] = n;
				n++;
				if (n == 8){
					n = 1;
				}
			}
		}
	}
	
	while (1){
		
		scanf("%d %d", &month, &da);
		if (month == 0){
			return (0);
		}
		
		//printf("%d\n", day[month][da]);
		
		switch (day[month][da]){
			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;
			
			case 7:
			printf("Sunday\n");
			break;
		}
	}
}