implicit none
character s*10
integer y,m

read(5,*) s

read(s(1:4),*)y
read(s(6:7),*)m

if(y.lt.2019) then
write(6,*) 'Heisei'
else if(y.eq.2019 .and. m .le.4) then
write(6,*) 'Heisei'
else
write(6,*) 'TBD'
endif

end