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

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

print(("Heisei" if eval(input()) < "2019/05/01" else "TBD"))

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