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

int main(){
	int m,d;
	while(cin >> m >> d){
		if(m == 0 && d == 0)break;
		int n = 0;
		for(int i = 1; i < m; i++){
			if(i == 2)n += 29;
			else if(i == 4 || i == 6 || i == 9 || i == 11)n += 30;
			else n += 31;
		}
		n += d;
		switch(n % 7){
			case 0:
				cout << "Wednesday" << endl;
				break;
			case 1:
				cout << "Thursday" << endl;
				break;
			case 2:
				cout << "Friday" << endl;
				break;
			case 3:
				cout << "Saturday" << endl;
				break;
			case 4:
				cout << "Sunday" << endl;
				break;
			case 5:
				cout << "Monday" << endl;
				break;
			case 6:
				cout << "Tuesday" << endl;
				break;
		}
	}
}
