import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int month = sc.nextInt();
int day = sc.nextInt();
int [] dayOfMonth = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int count = 0;
for(int i=1;i<month;i++) {
count += dayOfMonth[i-1];
}
count += day;
switch(count % 7) {
case 0:
System.out.println("SUN");
break;
case 1:
System.out.println("MON");
break;
case 2:
System.out.println("TUE");
break;
case 3:
System.out.println("WED");
break;
case 4:
System.out.println("THU");
break;
case 5:
System.out.println("FRI");
break;
case 6:
System.out.println("SAT");
break;
}
}
}