program aaa
implicit none

character(10) :: s
integer :: y, m, d

read(*,'(a10)') s
read(s(1:4),*) y
read(s(6:7),*) m 
read(s(9:10),*) d 

if(y*1000+m*100+d>2019430) then
write(*,'(a3)') 'TBD'
else
write(*,'(a6)') 'Heisei'
end if

end program