import Data.Array (listArray, (!))

main = do
    [month,day] <- (map read . words) `fmap` getLine
    if month == 0 || day == 0 then return () else do
        putStrLn (dayName month day)
        main

dayName month day = dayNames !! index
    where
    index = (offset + daysToMonth!month + day) `mod` 7

dayNames = ["Monday", "Tuesday", "Wednesday", "Thursday",
            "Friday", "Saturday", "Sunday"]
offset = 2

daysToMonth =
    listArray (1,12) (scanl (+) 0 [31,29,31,30,31,30,31,31,30,31,30,31])