#include<iostream>
using namespace std;
int main(){
  int tuki[13]={0,0,31,60,91,121,152,182,213,244,274,305,335};
  string cal[400];
  cal[1]="Thursday";cal[2]="Friday";cal[3]="Saturday";cal[4]="Sunday";
  cal[5]="Monday";cal[6]="Tuesday";cal[7]="Wednesday";
  for(int i=1;i<=366;i++)
    cal[i+7]=cal[i];
  int a,b;
  while(cin>>a>>b,a+b)
    cout<<cal[tuki[a]+b]<<endl;
  return 0;
}
#include<stdio.h>
int main()
{
int p[12]={31,29,31,30,31,30,31,31,30,31,30,31};
int M,D,sum;
while(1)
{
sum=0;
scanf("%d",&M);
scanf("%d",&D);if(M==0)break;
if(M==0)break;
for(int i=0;i<M-1;i++)
sum+=p[i];

sum+=D;

switch(sum%7)
{
case 4:
printf("Sunday\n");break;
case 5:
printf("Monday\n");break;

case 6:
printf("Tuesday\n");break;

case 0:
printf("Wednesday\n");break;

case 1:
printf("Thursday\n");break;

case 2:
printf("Friday\n");break;

case 3:
printf("Saturday\n");break;
}
}
return 0;
}