https://www.acmicpc.net/problem/1924
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner s=new Scanner(System.in);
int x=s.nextInt(), y=s.nextInt();
int arr[]={31,28,31,30,31,30,31,31,30,31,30,31};
int sum=0;
for(int i=0;i<x-1;i++){
sum+=arr[i];
}
int day=sum+y;
if(day%7==0) System.out.print("SUN");
else if(day%7==1) System.out.print("MON");
else if(day%7==2) System.out.print("TUE");
else if(day%7==3) System.out.print("WED");
else if(day%7==4) System.out.print("THU");
else if(day%7==5) System.out.print("FRI");
else System.out.print("SAT");
}
}