#include<iostream>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main(){
	while(1){int a,b;
	cin>>a>>b;
	if(a==0){
	break;}
	if(a==12){b+=335;}else
	if(a==11){b+=305;}else
	if(a==10){b+=274;}else
	if(a==9){b+=244;}else
	if(a==8){b+=213;}else
	if(a==7){b+=182;}else
	if(a==6){b+=152;}else
	if(a==5){b+=121;}else
	if(a==4){b+=91;}else
	if(a==3){b+=60;}else
	if(a==2){b+=31;}
	if(b%7==1){
	cout<<"Thursday"<<endl;}else
		if(b%7==2){
	cout<<"Friday"<<endl;}else
	if(b%7==3){
	cout<<"Saturday"<<endl;}else
		if(b%7==4){
	cout<<"Sunday"<<endl;}else
	if(b%7==5){
	cout<<"Monday"<<endl;}else
	if(b%7==6){
	cout<<"Tuesday"<<endl;}else{
	cout<<"Wednesday"<<endl;}}
	return 0;}
