#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
#include<list>

using namespace std;

typedef  long long int lint;

#define rep(i, n) for (lint i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define mp make_pair
#define IP pair<int,int>
#define enld endl

int main() {
	vector<lint>A;
	A = {0,31,29,31,30,31,30,31,31,30,31,30,31 };
	vector<lint>S(13);
	S[0] = A[0];
	for (lint i = 1; i < 13; i++) {
		S[i] = S[i - 1] + A[i];
	}
	vector<string>B;
	B = { "Monday","Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" };

	lint M, D;
	while (cin >> M >> D,!(M==0&&D==0)) {
		lint ALL = S[M - 1] + D;
		//cout << ALL << enld;
		cout << B[(ALL+2) % 7] << endl;
	}
}
