#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>
#include<iomanip>
 
#define EPS (1e-10)
using namespace std;
#define PI (3.1415926535)

int main(){
	string day[] = {"Wednesday", "Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday"};

	int month[] = {0, 31, 29, 31,
		30, 31, 30,
		31, 31, 30,
		31, 30, 31};

	int m, d;
	while(cin >> m >> d){
		if(m == 0 && d == 0){
			break;
		}
		for(int i = 1; i < m; i++){
			d += month[i];
		}

		cout << day[d%7] << endl;
	}

	return 0;
}