main = do
    s <- getLine
    putStrLn $ if isHeisei s then "heisei" else "TBD"

isHeisei :: String -> Bool
isHeisei s
    | y < 2019 = True
    | y > 2019 = False
    | y == 2019 = case () of
       () | m < 4 -> True
       () | m > 4 -> False
       () | m == 4 -> d <= 30
    where 
        y = read $ take 4 s
        m = read $ take 2 $ drop 5 s
        d = read $ drop 8 s
