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

print(("Heisei" if y < 2019 else "Heisei" if y == 2019 and m < 4 else "Heisei" if y == 2019 and m == 4 and d <= 30 else "TBD"))

s = eval(input())

print(("Heisei" if s <= "2019/04/30" else "TBD"))

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

s = eval(input())
print(("Heisei" if s <= "2019/04/30" else "TBD"))

-y, m, d = list(map(int, input().split("/"))) -print( -    ( -        "Heisei" -        if y < 2019 -        else "Heisei" -        if y == 2019 and m < 4 -        else "Heisei" -        if y == 2019 and m == 4 and d <= 30 -        else "TBD" -    ) -) +s = eval(input()) +print(("Heisei" if s <= "2019/04/30" else "TBD"))