print(('TBD'*(input()[5:]>'04/30')or'Heisei'))
print(('TBD'*(input()[5:7]>'04')or'Heisei'))
print(("TBD" * (input()[5:] > "04/30") or "Heisei"))

print(("TBD" * (input()[5:7] > "04") or "Heisei"))

-print(("TBD" * (input()[5:] > "04/30") or "Heisei")) +print(("TBD" * (input()[5:7] > "04") or "Heisei"))