#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
using namespace std;
typedef long long int ll;

string s[]={"Wednesday","Thursday","Friday","Saturday","Sunday","Monday","Tuesday"};

int day(int n){
	if(n==1)return 0;
	else{
		int res;
		n--;
		if(n==1||n==3||n==5||n==7||n==8||n==10||n==12){
			res=31;
		}
		else if(n==2){
			res=29;
		}
		else{
			res=30;
		}
		return res+day(n);
	}
}


int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	while(1){
		int n; cin >> n;
		if(n==0)break;
		int m; cin >> m;
		int sum=m+day(n);
		cout << s[sum%7] << endl;
	}
}
