Problem:
Score : 100 points

Problem Statement

You are given a string S as input. This represents a valid date in the year 2019 in the yyyy/mm/dd format. (For example, April 30, 2019 is represented as 2019/04/30.)

Write a program that prints Heisei if the date represented by S is not later than April 30, 2019, and prints TBD otherwise.

Constraints

S is a string that represents a valid date in the year 2019 in the yyyy/mm/dd format.

Input

Input is given from Standard Input in the following format:

S

Output

Print Heisei if the date represented by S is not later than April 30, 2019, and print TBD otherwise.

Sample Input 1

2019/04/30

Sample Output 1

Heisei

Sample Input 2

2019/11/01

Sample Output 2

TBD

Solution in C (GCC 5.4.1) (judge verdict: Wrong Answer)

#include<stdio.h>

int main(){
  int year,mon,day,lastd,scan;
  int days[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

  //入力取得
  scan = scanf("%d/%d/%d",&year,&mon,&day);

  lastd = days[mon-1];
  //うるう年
  if(mon == 2){
    if( year % 4 == 0 && year % 100 != 0 || year % 400 == 0 ) lastd = 29;
  }

  if(0 < day && day < lastd){
    //月が１～4か
    if(mon<5){
      //2019年までであれば'Heisei'
      if(year < 2020){
        printf("Heisei\n");
      }
      //月が5以上12以下で2018年までであれば'Heisei'
    }else if(mon < 13 && year < 2019){
      printf("Heisei\n");
    }else{
      //条件に当てはまらなければ'TBD'
      printf("TBD\n");
    }
  }else{
    printf("入力された日付が存在しません。\n");
  }
  return 0;
}