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

read*,s

read(s(1:4),*),y
read(s(2:3),*),m
read(s(2:3),*),d

if( y<2019 ) goto 200
if( y>2019 ) goto 100
if( m<4 ) goto 200
if( m>4 ) goto 100
if( d<31 ) goto 100


100 continue
print*,'TBD'
stop
200 continue
print*,'Heisei'
stop
end
