s = input().split("/")

for i in range(3):

    s[i] = int(s[i])

p = "TBD"

if s[0] <= 2019:

    if s[1] <= 4:

        if s[2] <= 30:

            p = "Heisei"

print(p)
s = input().split("/")

for i in range(3):

    s[i] = int(s[i])

p = "TBD"

if s[0] <= 2019 and s[1] <= 4 and s[2] <= 30:

    p = "Heisei"

print(p)

s = input().split("/")
for i in range(3):
    s[i] = int(s[i])
p = "TBD"
if s[0] <= 2019:
    if s[1] <= 4:
        if s[2] <= 30:
            p = "Heisei"
print(p)

s = input().split("/")
for i in range(3):
    s[i] = int(s[i])
p = "TBD"
if s[0] <= 2019 and s[1] <= 4 and s[2] <= 30:
    p = "Heisei"
print(p)

-if s[0] <= 2019: -    if s[1] <= 4: -        if s[2] <= 30: -            p = "Heisei" +if s[0] <= 2019 and s[1] <= 4 and s[2] <= 30: +    p = "Heisei"