s=eval(input())

s=int(s.replace("/",""))

print(("Heisei" if s<=20190430 else "TBD"))
s=eval(input())

s=int(s.replace("/",""))

print((["Heisei","TBD"][s>20190430]))
s = eval(input())
s = int(s.replace("/", ""))
print(("Heisei" if s <= 20190430 else "TBD"))

s = eval(input())
s = int(s.replace("/", ""))
print((["Heisei", "TBD"][s > 20190430]))

-print(("Heisei" if s <= 20190430 else "TBD")) +print((["Heisei", "TBD"][s > 20190430]))