import datetime

y,m,d=list(map(int,input().split('/')))

print(('Heisei' if datetime.datetime(y, m, d, 0, 0) <= datetime.datetime(2019, 4, 30, 0, 0) else 'TBD'))
print(('Heisei' if '20190430' >= ''.join(input().split('/')) else 'TBD'))

import datetime

y, m, d = list(map(int, input().split("/")))
print(
    (
        "Heisei"
        if datetime.datetime(y, m, d, 0, 0) <= datetime.datetime(2019, 4, 30, 0, 0)
        else "TBD"
    )
)

print(("Heisei" if "20190430" >= "".join(input().split("/")) else "TBD"))

-import datetime - -y, m, d = list(map(int, input().split("/"))) -print( -    ( -        "Heisei" -        if datetime.datetime(y, m, d, 0, 0) <= datetime.datetime(2019, 4, 30, 0, 0) -        else "TBD" -    ) -) +print(("Heisei" if "20190430" >= "".join(input().split("/")) else "TBD"))