S = eval(input())



month = int(S[5] + S[6])



day = int(S[-2] + S[-1])





if month < 4:

    print("Heisei")

elif month == 4 and day <= 30:

    print("Heisei")

else:

    print("TBD")

day = eval(input())

if int(day[5:7]) < 5:

  print("Heisei")

else:

  print("TBD")
S = eval(input())
month = int(S[5] + S[6])
day = int(S[-2] + S[-1])
if month < 4:
    print("Heisei")
elif month == 4 and day <= 30:
    print("Heisei")
else:
    print("TBD")

day = eval(input())
if int(day[5:7]) < 5:
    print("Heisei")
else:
    print("TBD")

-S = eval(input()) -month = int(S[5] + S[6]) -day = int(S[-2] + S[-1]) -if month < 4: -    print("Heisei") -elif month == 4 and day <= 30: +day = eval(input()) +if int(day[5:7]) < 5: