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: Accepted)

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#define MAX_BUF 11
#define YEAR_BUF 5
#define MONTH_BUF 3
#define DAY_BUF 3

int main()
{
	char buf[MAX_BUF];
	char year[YEAR_BUF];
	char month[MONTH_BUF];
	char day[DAY_BUF]; 
	int i, j, flag = 0;
	int Year, Month, Day;
	int sum = 0;

	scanf("%s", buf);

	for (i = 0, j = 0; i < MAX_BUF; i++) {
		if (i <= 3) {
			year[j] = buf[i];
			j++;
		} else if (i == 4) {
			j = 0;
		} else if (i >= 5 && i <= 6) {
			month[j] = buf[i];
			j++;
		} else if (i == 7) {
			j = 0;
		} else if (i >= 8 && i <= 9) {
			day[j] = buf[i];
			j++;
		}
	}

	year[YEAR_BUF - 1] = '\0';
	month[MONTH_BUF - 1] = '\0';
	day[DAY_BUF - 1] = '\0';

	Year = atoi(year);
	Month = atoi(month);
	Day = atoi(day);

	sum += Year * 10000;
	sum += Month * 100;
	sum += Day;
	
	if (sum <= 20190430) {
		printf("Heisei\n");
	} else {
		printf("TBD\n");
	}

	return 0;
}