import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int m = sc.nextInt();
		int d = sc.nextInt();
		int totaldays = 0;
		int yo = 0;
		
		int[] dayArr = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
		String[] yoArr = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
		
		for(int i = 1 ; i < m ; i++) {
			totaldays += dayArr[i];
		}
		totaldays += d;	
		yo = totaldays % 7;
		System.out.println(yoArr[yo]);		
	}
}

'JAVA > 백준' 카테고리의 다른 글

[입출력] 백준 11720  (0) 2021.07.30
[입출력] 백준 11719  (0) 2021.07.30
[입출력] 백준 2741  (0) 2021.07.30
[입출력] 백준 2739  (0) 2021.07.30
[입출력] 백준 1000  (0) 2021.07.30