open String

let still_tbd s =
  let y,m,d = ( int_of_string (sub s 0 4),
                int_of_string (sub s 5 2),
                int_of_string (sub s 8 2) )
  in
    if y >= 2020 then "TBD"
                 else if y = 2019 then if m >= 5 then "TBD"
                                                 else "Heisei"
                                  else "Heisei"

let () = Scanf.scanf "%s" still_tbd |> Printf.printf "%s\n"