#include <bits/stdc++.h>
using namespace std;

typedef complex<double> P;

string dow[] = {
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday"
};
int main(){
	int m,d;
	while( cin >> m >> d && m ){
		int h = 3;
		for(int i = 1 ; i <= 12 ; i++){
			for(int j = 1 ; j <= vector<int>{-1,31,29,31,30,31,30,31,31,30,31,30,31}[i] ; j++){
				
				if( i == m and j == d ){
					cout << dow[h] << endl;
					goto exit;
				}
				h = (h+1) % 7;
			}
		}
		exit:;
	}
	
			
			
}