https://www.acmicpc.net/problem/1924
#include<stdio.h>
int main() {
int x,y;
scanf("%d %d",&x,&y);
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) printf("SUN");
else if(day%7==1) printf("MON");
else if(day%7==2) printf("TUE");
else if(day%7==3) printf("WED");
else if(day%7==4) printf("THU");
else if(day%7==5) printf("FRI");
else printf("SAT");
}