s = eval(input())

m = int(s[5:7])

d = int(s[8:10])

tt = m * 100 + d

print(('Heisei' if tt <= 430 else 'TBD'))
y,m,d = list(map(int, input().split('/')))



if y < 2019 or (y == 2019 and m <= 4):

  print('Heisei')

else:

  print('TBD')
s = eval(input())
m = int(s[5:7])
d = int(s[8:10])
tt = m * 100 + d
print(("Heisei" if tt <= 430 else "TBD"))

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

-s = eval(input()) -m = int(s[5:7]) -d = int(s[8:10]) -tt = m * 100 + d -print(("Heisei" if tt <= 430 else "TBD")) +y, m, d = list(map(int, input().split("/"))) +if y < 2019 or (y == 2019 and m <= 4): +    print("Heisei") +else: +    print("TBD")