program main
    use,intrinsic :: iso_fortran_env
    implicit none
    character(10):: s
    integer(int32):: y,m,d


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

    if (y < 2019) then
        print'(a)', 'Heisei'
        stop
    else if (y > 2019) then
        print'(a)', 'TBD'
        stop
    end if

    IF ( m < 4) then
        print'(a)', 'Heisei'
        stop
    else if (m > 4) then
        print'(a)', 'TBD'
        stop
    end if

    if (d <= 30) then
        print*, 'Heisei'
    else
        print*, 'TBD'
    end if
end program main