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

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

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

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