import Control.Arrow
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B

main :: IO ()
main = getLine >>= putStrLn . solve 

solve :: String -> String
solve s
    | y >= 2019 && m > 4 = "TBD"
    | otherwise = "Heisei"
    where
        y = read $ take 4 s :: Int
        m = read . take 2 $ drop 5 s :: Int

readLine :: IO [Int]
readLine = unfoldr (fmap (second (maybe B.empty snd . B.uncons)) . B.readInt) <$> B.getLine

readContents :: Int -> IO [[Int]]
readContents = flip replicateM readLine