import Data.List.Split (splitOn) import Text.Printf main :: IO () main = solve <$> map read <$> splitOn "/" <$> getLine >>= printDate solve :: [Int] -> (Int, Int, Int) solve [y, m, d] = correct (y, m, d + 2) printDate (y, m, d) = printf "%d/%02d/%02d\n" y m d isLeap y = y `mod` 400 == 0 || y `mod` 100 /= 0 && y `mod` 4 == 0 lastDay :: Int -> Int -> Int lastDay _ 1 = 31 lastDay y 2 = if isLeap y then 29 else 28 lastDay _ 3 = 31 lastDay _ 4 = 30 lastDay _ 5 = 31 lastDay _ 6 = 30 lastDay _ 7 = 31 lastDay _ 8 = 31 lastDay _ 9 = 30 lastDay _ 10 = 31 lastDay _ 11 = 30 lastDay _ _ = 31 correct :: (Int, Int, Int) -> (Int, Int, Int) correct (y, m, d) | m == 13 = (y + 1, 1, d) | ld < d = correct (y, m + 1, d - ld) | otherwise = (y, m, d) where ld = lastDay y m