#include <iostream>
#include <string>
using namespace std;

int zeller(int y, int m, int d){
	if( m <= 2){
		y--;
		m += 12;
	}
	return ( ( y + y/4 - y/100 + y/400 + (13*m+8)/5 + d ) % 7);
}

int main(){
	string week[7] = {"Sunday","Mondey","Tuesday","Wednesday","Thursday","Friday","Saturday"};
	int y=2004, m, d;

	while( cin >> m >> d , m ){
		cout << week[ zeller( y , m , d ) ] << endl;
	}
}