import Control.Monad
import Control.Applicative
import Data.Functor
import Data.List
import Data.List.Split
import Data.Char
import Data.Array.IO
import Data.Time.Calendar.MonthDay

readInt = read :: String -> Int
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
-- end of templete



main = do
    [m, d] <- getInts
    when (m/=0) ((putStrLn $ ["Wednesday", "Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday"] !! (flip mod 7 $ monthAndDayToDayOfYear True m d)) >> main)