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

if int(y)<=2019 and (int(m)<=4 and int(d)<=30):

    print("Heisei")

else:

    print("TBD")
y,m,d = input().split('/')

if int(y)<=2019 and int(m)<=4 and int(d)<=30: print("Heisei")

else: print("TBD")
y, m, d = input().split("/")
if int(y) <= 2019 and (int(m) <= 4 and int(d) <= 30):
    print("Heisei")
else:
    print("TBD")

y, m, d = input().split("/")
if int(y) <= 2019 and int(m) <= 4 and int(d) <= 30:
    print("Heisei")
else:
    print("TBD")

-if int(y) <= 2019 and (int(m) <= 4 and int(d) <= 30): +if int(y) <= 2019 and int(m) <= 4 and int(d) <= 30: