#define _USE_MATH_DEFINES
#include <iostream>
#include <queue>
#include <vector>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <cctype>
#include <cstdlib>
using namespace std;

#define INF (1 << 20)
#define EPS (1e-10)
#define EQ(a,b) (fabs((a)-(b)) < EPS)

int main(){
	int dn[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	string youbi[7] = {"Monday", "Tuesday", "Wednesday", "Thursday",
		"Friday", "Saturday", "Sunday"};
	int m, d;
	while (cin >> m >> d) {
		if (m == 0) break;
		int sum = 0;
		for (int i = 1; i < m; ++i) {
			sum += dn[i];
		}
		sum += d;
		cout << youbi[(sum + 2) % 7] << endl;
	}
	return 0;
}