s = eval(input())

s = list(map(int, s.split("/")))

if s[0] <= 2019 and s[1] <= 4 and s[2] <= 30:

    print("Heisei")

else:

    print("TBD")
s = list(map(int, input().split("/")))

if s[1] <= 4:

    print("Heisei")

else:

    print("TBD")
s = eval(input())
s = list(map(int, s.split("/")))
if s[0] <= 2019 and s[1] <= 4 and s[2] <= 30:
    print("Heisei")
else:
    print("TBD")

s = list(map(int, input().split("/")))
if s[1] <= 4:
    print("Heisei")
else:
    print("TBD")

-s = eval(input()) -s = list(map(int, s.split("/"))) -if s[0] <= 2019 and s[1] <= 4 and s[2] <= 30: +s = list(map(int, input().split("/"))) +if s[1] <= 4: