https://www.acmicpc.net/problem/1924
using System;
class Program
{
static void Main() {
string[] s=Console.ReadLine().Split(' ');
int x=int.Parse(s[0]);
int y=int.Parse(s[1]);
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) Console.Write("SUN");
else if(day%7==1) Console.Write("MON");
else if(day%7==2) Console.Write("TUE");
else if(day%7==3) Console.Write("WED");
else if(day%7==4) Console.Write("THU");
else if(day%7==5) Console.Write("FRI");
else Console.Write("SAT");
}
}