#include <stdio.h>

int main(void)
{
	int month = 1, day = 1;
	
	while ((month != 0) && (day != 0)){
		scanf("%d %d", &month, &day);
		
		if ((month == 1) || (month == 4) || (month == 7)){
			switch (day % 7){
			  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;
			}
		}
		
		if ((month == 2) || (month == 8)){
			switch (day % 7){
			  case 4:
			  	printf("Wednesday\n");
			  	break;
			  case 5:
			  	printf("Thursday\n");
			  	break;
			  case 6:
			  	printf("Friday\n");
			  	break;
			  case 0:
			  	printf("Saturday\n");
			  	break;
			  case 1:
			  	printf("Sunday\n");
			  	break;
			  case 2:
			  	printf("Monday\n");
			  	break;
			  case 3:
			  	printf("Tuesday\n");
			  	break;
			}
		}
			
		if ((month == 3) || (month == 11)){
			switch (day % 7){
			  case 3:
			  	printf("Wednesday\n");
			  	break;
			  case 4:
			  	printf("Thursday\n");
			  	break;
			  case 5:
			  	printf("Friday\n");
			  	break;
			  case 6:
			  	printf("Saturday\n");
			  	break;
			  case 0:
			  	printf("Sunday\n");
			  	break;
			  case 1:
			  	printf("Monday\n");
			  	break;
			  case 2:
			  	printf("Tuesday\n");
			  	break;
			}
		}
			
		if (month == 5){
			switch (day % 7){
			  case 5:
			  	printf("Wednesday\n");
			  	break;
			  case 6:
			  	printf("Thursday\n");
			  	break;
			  case 0:
			  	printf("Friday\n");
			  	break;
			  case 1:
			  	printf("Saturday\n");
			  	break;
			  case 2:
			  	printf("Sunday\n");
			  	break;
			  case 3:
			  	printf("Monday\n");
			  	break;
			  case 4:
			  	printf("Tuesday\n");
			  	break;
			}
		}
			
		if (month == 6){
			switch (day % 7){
			  case 2:
			  	printf("Wednesday\n");
			  	break;
			  case 3:
			  	printf("Thursday\n");
			  	break;
			  case 4:
			  	printf("Friday\n");
			  	break;
			  case 5:
			  	printf("Saturday\n");
			  	break;
			  case 6:
			  	printf("Sunday\n");
			  	break;
			  case 0:
			  	printf("Monday\n");
			  	break;
			  case 1:
			  	printf("Tuesday\n");
			  	break;
			}
		}
			
		if ((month == 9) || (month == 12)){
			switch (day % 7){
			  case 1:
			  	printf("Wednesday\n");
			  	break;
			  case 2:
			  	printf("Thursday\n");
			  	break;
			  case 3:
			  	printf("Friday\n");
			  	break;
			  case 4:
			  	printf("Saturday\n");
			  	break;
			  case 5:
			  	printf("Sunday\n");
			  	break;
			  case 6:
			  	printf("Monday\n");
			  	break;
			  case 0:
			  	printf("Tuesday\n");
			  	break;
			}
		}
			
		if (month == 10){
			switch (day % 7){
			  case 6:
			  	printf("Wednesday\n");
			  	break;
			  case 0:
			  	printf("Thursday\n");
			  	break;
			  case 1:
			  	printf("Friday\n");
			  	break;
			  case 2:
			  	printf("Saturday\n");
			  	break;
			  case 3:
			  	printf("Sunday\n");
			  	break;
			  case 4:
			  	printf("Monday\n");
			  	break;
			  case 5:
			  	printf("Tuesday\n");
			  	break;
			}
		}
	}
	
	return (0);
}

Measured memory_bytes: 0