import datetime



a  = (datetime.datetime.strptime('2019/04/30', '%Y/%m/%d') - datetime.datetime.strptime(eval(input()), '%Y/%m/%d')).days



print(('Heisei' if a >= 0 else 'TBD'))

yy, mm, dd = input().split('/')



last_yy, last_mm, last_dd = '2019/04/30'.split('/')

if last_yy < yy:

    ans = 'TBD'

else:

    if last_mm < mm:

        ans = 'TBD'

    else:

        if last_dd < dd:

            ans = 'TBD'

        else:

            ans = 'Heisei'



print(ans)

import datetime

a = (
    datetime.datetime.strptime("2019/04/30", "%Y/%m/%d")
    - datetime.datetime.strptime(eval(input()), "%Y/%m/%d")
).days
print(("Heisei" if a >= 0 else "TBD"))

yy, mm, dd = input().split("/")
last_yy, last_mm, last_dd = "2019/04/30".split("/")
if last_yy < yy:
    ans = "TBD"
else:
    if last_mm < mm:
        ans = "TBD"
    else:
        if last_dd < dd:
            ans = "TBD"
        else:
            ans = "Heisei"
print(ans)

-import datetime - -a = ( -    datetime.datetime.strptime("2019/04/30", "%Y/%m/%d") -    - datetime.datetime.strptime(eval(input()), "%Y/%m/%d") -).days -print(("Heisei" if a >= 0 else "TBD")) +yy, mm, dd = input().split("/") +last_yy, last_mm, last_dd = "2019/04/30".split("/") +if last_yy < yy: +    ans = "TBD" +else: +    if last_mm < mm: +        ans = "TBD" +    else: +        if last_dd < dd: +            ans = "TBD" +        else: +            ans = "Heisei" +print(ans)