#include<stdlib.h>
#include<stdio.h>

int main(){
  int m[366],d[366],i,add,n,num[366];
  i=0;
  do{
    scanf("%d %d",&m[i],&d[i]);
    ++i;
  }while(m[i-1]!=0);
  for(n=0;n<i-1;++n){
    add=0;
    switch(m[n]){
    case 12:
      add+=30;
    case 11:
      add+=31;
    case 10:
      add+=30;
    case 9:
      add+=31;
    case 8:
      add+=31;
    case 7:
      add+=31;
    case 6:
      add+=31;
    case 5:
      add+=30;
    case 4:
      add+=31;
    case 3:
      add+=29;
    case 2:
      add+=31;
    case 1:
      add+=0;
    
    }

    num[n]=(add+d[n])%7;
  
    switch(num[n]){
    case 0:
      printf("Wednesday\n");
      break;
    case 1:
      printf("Thursday\n");
      break;
    case 2:
      printf("Friday\n");
      break;
    case 3:
      printf("Saturday\n");
      break;
    case 4:
      printf("Sunday\n");
      break;    
    case 5:
      printf("Monday\n");
      break;    
    case 6:
      printf("Tuesday\n");
      break;
    }
  }
  return 0;
}
	