AtCoder Beginner Contest 119 - Still TBD

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-----
2019/04/30

-----Sample Output-----
Heisei

Source: atcoder | Difficulty: EASY


Solutions:
from datetime import datetime
S = input()
heiei = datetime(2019, 4, 30)
date = datetime.strptime(S, '%Y/%m/%d')
if heiei >= date:
	print('Heisei')
else:
	print('TBD')


print('TBD' if int(input().split('/')[1]) >= 5 else 'Heisei')


S = list(map(int, input().split('/')))
if S[0] > 2019:
	print('TBD')
elif S[0] == 2019 and S[1] > 4:
	print('TBD')
else:
	print('Heisei')


s = input()
if int(s[5] + s[6]) >= 5:
	print('TBD')
else:
	print('Heisei')


S = input()
print('Heisei' if S <= '2019/04/30' else 'TBD')


s = [int(i) for i in input().split('/')]
ans = 'TBD'
if s[0] <= 2018:
	ans = 'Heisei'
elif s[0] == 2019 and s[1] <= 4:
	ans = 'Heisei'
print(ans)


s = input()
print('Heisei') if s[5:7] <= '04' else print('TBD')


S = input()
if int(S[5:7]) > 4:
	ans = 'TBD'
else:
	ans = 'Heisei'
print(ans)


s = input()
if int(s[5:7]) > 4:
	print('TBD')
else:
	print('Heisei')


print('Heisei' if int(input().replace('/', '')) < 20190501 else 'TBD')


S = input()
print('Heisei' if int(S[5]) * 10 + int(S[6]) <= 4 else 'TBD')


s = input()
print('Heisei' if int(s[5:7] + s[8:10]) <= 430 else 'TBD')


s = input()
print('TBD' if s > '2019/04/30' else 'Heisei')


(y, m, d) = map(int, input().split('/'))
if m >= 5:
	print('TBD')
else:
	print('Heisei')


x = input()
if int(x[5:7]) < 5:
	print('Heisei')
else:
	print('TBD')


(a, b, c) = map(int, input().split('/'))
print('Heisei' if b < 5 else 'TBD')


s = input()
year = int(s[:4])
mo = int(s[5:7])
if year < 2019:
	ans = 'Heisei'
elif year == 2019 and mo <= 4:
	ans = 'Heisei'
else:
	ans = 'TBD'
print(ans)


s = input()
print('Heisei' if s[6] < '5' and s[5] == '0' else 'TBD')


(a, b, c) = input().split('/')
if int(a) <= 2019:
	if int(b) <= 4:
		if int(c) <= 30:
			print('Heisei')
		else:
			print('TBD')
	else:
		print('TBD')
else:
	print('TBD')


print('HTeBiDs e i'[int(input().replace('/', '')) > 20190430::2])


print('Heisei' if int(input().replace('/', '')) < 20190431 else 'TBD')


S = input()
m = int(S[5:7])
print('Heisei') if m <= 4 else print('TBD')


a = input()
if a[5] == '1':
	print('TBD')
elif int(a[6]) > 4:
	print('TBD')
else:
	print('Heisei')


(y, m, d) = input().split('/')
if int(m) > 4:
	print('TBD')
else:
	print('Heisei')


s = int(input().replace('/', ''))
print(['Heisei', 'TBD'][s > 20190430])


a = input()
if int(a[5:7]) <= 4:
	print('Heisei')
else:
	print('TBD')


t = 20190430
s = input()
if int(s.replace('/', '')) > t:
	print('TBD')
else:
	print('Heisei')


import math
s = input()
print('Heisei' if s <= '2019/04/30' else 'TBD')


s = str(input())
if int(s[0:4]) < 2019:
	print('Heisei')
elif int(s[0:4]) < 2020 and int(s[5:7]) <= 4:
	print('Heisei')
else:
	print('TBD')


(y, m, d) = map(int, input().split('/'))
if m <= 4 and d <= 31:
	print('Heisei')
else:
	print('TBD')


print('Heisei' if input().replace('/', '') <= '20190430' else 'TBD')


S = input()
if int(S[0:4]) > 2019:
	print('TBD')
	return
elif int(S[0:4]) == 2019:
	if int(S[5:7]) >= 5:
		print('TBD')
		return
print('Heisei')


date = input()
print('Heisei' if date <= '2019/04/30' else 'TBD')


a = list(input().split('/'))
month = int(a[1])
date = int(a[2])
if month < 4:
	print('Heisei')
elif month == 4 and date <= 30:
	print('Heisei')
else:
	print('TBD')


(y, m, d) = list(map(int, input().split('/')))
if 10000 * y + 100 * m + d <= 20190430:
	print('Heisei')
else:
	print('TBD')


print(['TBD', 'Heisei'][input()[5:7] < '05'])


s = ''.join(input().split('/'))
print('Heisei' if s <= '20190430' else 'TBD')


s = input()
if int(s[5:5 + 2]) >= 5:
	print('TBD')
else:
	print('Heisei')


(_, b, _) = input().split('/')
print('Heisei' if int(b) < 5 else 'TBD')


print(['Heisei', 'TBD'][int(input().split('/')[1]) > 4])


print(['Heisei', 'TBD'][input() > '2019/04/30'])


S = input()
print('TBD' if S[5:7] > '04' else 'Heisei')


s = [int(x) for x in input().split('/')]
if s[1] < 4:
	print('Heisei')
elif s[1] == 4 and s[2] <= 30:
	print('Heisei')
else:
	print('TBD')


print('Heisei' if input() < '2019/04/31' else 'TBD')


(y, m, d) = list(map(int, input().split('/')))
flg = True
if y >= 2020:
	flg = False
if y == 2019 and m >= 5:
	flg = False
print('Heisei' if flg else 'TBD')


a = input()
print('Heisei' if a <= '2019/04/30' else 'TBD')


y = int(input().replace('/', ''))
print('Heisei' if y <= 20190430 else 'TBD')


(y, m, d) = map(int, input().split('/'))
if y < 2019 or (y == 2019 and m < 4) or (y == 2019 and m == 4 and (d <= 30)):
	print('Heisei')
else:
	print('TBD')


S = input()
if int(S[5:7]) < 5:
	print('Heisei')
else:
	print('TBD')


S = input()
S[6:8]
print('Heisei' if int(S[5:7]) <= 4 else 'TBD')


print('Heisei' if input() < '2019/05/01' else 'TBD')


def mapt(fn, *args):
	return tuple(map(fn, *args))

def main():
	s = mapt(int, input().split('/'))
	print('Heisei' if s <= (2019, 4, 30) else 'TBD')
main()


a = input()
a = a.replace('/', '')
if int(a) <= 20190430:
	print('Heisei')
else:
	print('TBD')


(y, m, d) = input().split('/')
print('TBD' if int(m + d) > 430 else 'Heisei')


s = input()
month = int(s[5:7])
print('Heisei' if month < 5 else 'TBD')


(y, m, d) = map(int, input().split('/'))
print(['TBD', 'Heisei'][m < 5])


a = input()
b = a[0:4] + a[5:7] + a[8:10]
if int(b) <= 20190430:
	print('Heisei')
else:
	print('TBD')


d = input()
print('Heisei' if d <= '2019/04/30' else 'TBD')


s = input()
s_i = s[0:4] + s[5:7] + s[-2:]
if int(s_i) <= 20190430:
	print('Heisei')
else:
	print('TBD')


S = input()
print('TBD' if S[6] >= '5' or S[5] >= '1' else 'Heisei')


S = str(input())
S = int(S.replace('/', ''))
if S > 20190430:
	print('TBD')
else:
	print('Heisei')


(y, m, d) = list(map(str, input().split('/')))
if 20190430 >= int(y + m + d):
	print('Heisei')
else:
	print('TBD')


s = 'TBD' if int(input().split('/')[1]) > 4 else 'Heisei'
print(s)


s = list(map(int, input().split('/')))
print('TBD' if s[1] > 4 else 'Heisei')


s = input()
month = int(s[5:7])
if month < 4:
	ans = 'Heisei'
elif month == 4:
	day = int(s[8:])
	if day <= 30:
		ans = 'Heisei'
else:
	ans = 'TBD'
print(ans)


print(['Heisei', 'TBD'][input().split('/')[1] > '04'])


(y, m, d) = map(int, input().split('/'))
print('Heisei' * (m <= 4) or 'TBD')


S = list(input())
y = 1000 * int(S[0]) + 100 * int(S[1]) + 10 * int(S[2]) + int(S[3])
m = 10 * int(S[5]) + int(S[6])
d = 10 * int(S[8]) + int(S[9])
if y < 2019:
	print('Heisei')
elif y == 2019 and m <= 4:
	print('Heisei')
else:
	print('TBD')


S = input()
year = S[:4]
month = S[5:7]
day = S[8:10]
if int(year) < 2019:
	print('Heisei')
elif int(year) == 2019 and int(month) < 5 and (int(day) <= 30):
	print('Heisei')
else:
	print('TBD')


print(['Heisei', 'TBD'][input()[5:7] > '04'])


from datetime import *
(y1, m1, d1) = map(int, input().split('/'))
date1 = date(y1, m1, d1)
date2 = date(2019, 4, 30)
if date1 <= date2:
	print('Heisei')
else:
	print('TBD')


S = input()
D = int(S[5:7])
print('Heisei' if D <= 4 else 'TBD')


print('Heisei' if int(input()[-5:-3]) < 5 else 'TBD')


S = str(input())
if int(S[5:7]) <= 4:
	print('Heisei')
else:
	print('TBD')


(Y, M, D) = input().split('/')
S = int(Y + M + D)
if S <= 20190430:
	print('Heisei')
else:
	print('TBD')


(y, m, d) = input().split('/')
t = int(y + m + d)
if t <= 20190430:
	print('Heisei')
else:
	print('TBD')


print('Heisei' if input()[5:] < '04/31' else 'TBD')


a = input()
y = int(a[0:4])
m = int(a[5:7])
if y < 2019:
	print('Heisei')
elif y == 2019 and m <= 4:
	print('Heisei')
else:
	print('TBD')


n = input()
if int(n[5:7]) >= 5:
	print('TBD')
else:
	print('Heisei')


S = str(input())
if S[5] == '1' or int(S[6]) > 4:
	print('TBD')
else:
	print('Heisei')


S = input()
M = int(S[5:7])
print('TBD' if M > 4 else 'Heisei')


(y, m, d) = list(map(int, input().split('/')))
if y >= 2019 and m >= 5:
	print('TBD')
else:
	print('Heisei')


s = input()
a = int(s[5:7])
if 0 < a < 5:
	print('Heisei')
else:
	print('TBD')


(_, b, c) = map(int, input().split('/'))
print('HTeBiDs e i'[b > 4 and c > 0::2])


S = input()
y = int(S[:4])
m = int(S[5:7])
d = int(S[8:])
if y < 2019:
	print('Heisei')
elif y == 2019 and m < 4:
	print('Heisei')
elif y == 2019 and m == 4 and (d <= 30):
	print('Heisei')
else:
	print('TBD')


S = input()
if int(S[5]) == 0 and int(S[6]) < 4:
	print('Heisei')
elif int(S[6]) == 4 and int(S[-2:-1]) <= 30:
	print('Heisei')
else:
	print('TBD')


(a, b, c) = input().split('/')
print('Heisei' if b <= '04' else 'TBD')


(_, m, _) = map(int, input().split('/'))
print('TBD' if m > 4 else 'Heisei')


(y, m, d) = map(int, input().split('/'))
if m <= 4:
	ans = 'Heisei'
elif m > 4:
	ans = 'TBD'
print(ans)


import datetime
s = input()
s_date = datetime.datetime.strptime(s, '%Y/%m/%d')
last_date = '2019/05/01'
t_date = datetime.datetime.strptime(last_date, '%Y/%m/%d')
if s_date < t_date:
	print('Heisei')
else:
	print('TBD')


date = input()
list_date = date.split('/')
if int(list_date[0]) <= 2018:
	print('Heisei')
elif int(list_date[0]) <= 2019 and int(list_date[1]) <= 4:
	print('Heisei')
else:
	print('TBD')


(y, m, d) = list(map(int, input().split('/')))
if m <= 4 and d <= 30:
	print('Heisei')
else:
	print('TBD')


(a, b, c) = input().split('/')
if int(a) < 2019:
	print('Heisei')
elif int(a) == 2019 and int(b) <= 4:
	print('Heisei')
else:
	print('TBD')


print('TBD' if eval(input().replace('/', '')) > 20190500 else 'Heisei')


(_, m, d) = map(int, input().split('/'))
if m < 4:
	print('Heisei')
elif m == 4 and d < 31:
	print('Heisei')
else:
	print('TBD')


print(['Heisei', 'TBD'][int(input()[5:7]) > 4])


s = input()
if int(s[5]) == 1:
	print('TBD')
elif int(s[6]) < 5:
	print('Heisei')
else:
	print('TBD')


from datetime import datetime
S = input()
s = datetime.strptime(S, '%Y/%m/%d')
str_std = '2019/04/30'
std = datetime.strptime(str_std, '%Y/%m/%d')
if s <= std:
	print('Heisei')
else:
	print('TBD')


a = input()
if a[5:7] <= '04':
	print('Heisei')
else:
	print('TBD')


S = str(input())
if S[5:7] == '01' or S[5:7] == '02' or S[5:7] == '03' or (S[5:7] == '04'):
	print('Heisei')
else:
	print('TBD')


a = input().split('/')
print('Heisei' if int(a[1]) <= 4 else 'TBD')


a = input()
print('Heisei' if int(a[5:7] + a[8:]) < 500 else 'TBD')


S = input()
l = S.split('/')
if int(l[0]) <= 2019:
	if int(l[1]) <= 4:
		if int(l[2]) <= 30:
			print('Heisei')
			return
	print('TBD')


a = input()
if int(a[5] + a[6]) <= 4:
	print('Heisei')
else:
	print('TBD')


import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

def I():
	return int(input())

def F():
	return float(input())

def SS():
	return input()

def LI():
	return [int(x) for x in input().split()]

def LI_():
	return [int(x) - 1 for x in input().split()]

def LF():
	return [float(x) for x in input().split()]

def LSS():
	return input().split()

def resolve():
	S = SS()
	(y, m, d) = S.split('/')
	n = int(y + m + d)
	if n <= 20190430:
		print('Heisei')
	else:
		print('TBD')

def __starting_point():
	resolve()
__starting_point()


s = input()
if int(s[:4]) < 2019:
	print('Heisei')
elif int(s[:4]) > 2019:
	print('TBD')
elif int(s[5:7]) <= 4:
	print('Heisei')
elif int(s[5:7]) > 4:
	print('TBD')


S = input()
if int(S[5] + S[6]) >= 5:
	print('TBD')
else:
	print('Heisei')


S = input()
(y, m, d) = S.split('/')
(y, m, d) = (int(y), int(m), int(d))
if y == 2019:
	if m <= 4:
		if d <= 30:
			ans = 'Heisei'
		else:
			ans = 'TBD'
	else:
		ans = 'TBD'
elif y < 2019:
	ans = 'Heisei'
else:
	ans = 'TBD'
print(ans)


S = input()
if S[5] + S[6] <= '04':
	print('Heisei')
else:
	print('TBD')


S = input()
m = int(S[5:7])
d = int(S[8:10])
if m < 4:
	print('Heisei')
elif m == 4:
	if d == 31:
		print('TBD')
	else:
		print('Heisei')
else:
	print('TBD')


s = input()
if int(s[0:4]) < 2019:
	print('Heisei')
elif int(s[0:4]) > 2019:
	print('TBD')
elif int(s[5]) == 1 or int(s[6]) > 4:
	print('TBD')
elif int(s[6]) <= 4:
	print('Heisei')


s = input()
if s[5:7] == '04' or s[5:7] == '03' or s[5:7] == '02' or (s[5:7] == '01'):
	print('Heisei')
else:
	print('TBD')


def readinput():
	s = input()
	return s

def main(s):
	y = int(s[:4])
	m = int(s[5:7])
	d = int(s[9:])
	if m <= 4:
		return 'Heisei'
	else:
		return 'TBD'

def __starting_point():
	s = readinput()
	ans = main(s)
	print(ans)
__starting_point()


def lcm(a, b):
	return a * b // math.gcd(a, b)
MOD = 10 ** 9 + 7
(y, m, d) = list(map(int, input().split('/')))
if y < 2019 or (y == 2019 and m <= 4):
	print('Heisei')
else:
	print('TBD')


n = input()
print('Heisei' if n <= '2019/04/30' else 'TBD')


import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007

def main():
	S = readline().strip()
	(y, m, d) = list(map(int, S.split('/')))
	if m <= 4:
		print('Heisei')
	elif m > 4:
		print('TBD')
	return

def __starting_point():
	main()
__starting_point()


S = input()
print(['Heisei', 'TBD'][int(S[5:7] + S[8:10]) > 430])


print('Heisei' * (int(input().replace('/', '')) <= 20190430) or 'TBD')


import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007

def main():
	S = readline().strip()
	if S <= '2019/04/30':
		print('Heisei')
	else:
		print('TBD')
	return

def __starting_point():
	main()
__starting_point()


(a, b, c) = map(int, input().split('/'))
if a > 2019:
	print('TBD')
elif b * 100 + c > 430:
	print('TBD')
else:
	print('Heisei')


import math
str = input()
if str <= '2019/04/30':
	print('Heisei')
else:
	print('TBD')


ans1 = 'Heisei'
ans2 = 'TBD'
S = input().split('/')
if int(S[0]) > 2019 or (int(S[0]) == 2019 and int(S[1]) > 4):
	print(ans2)
else:
	print(ans1)


print('TBD' * (input()[5:] > '04/30') or 'Heisei')


S = input()
S = S.replace('/', '')
int_S = int(S)
print('Heisei' if int_S <= 20190430 else 'TBD')


list01 = input().split('/')
if int(list01[1]) <= 4:
	print('Heisei')
else:
	print('TBD')


n = int(input().replace('/', ''))
print('Heisei' if n <= 20190430 else 'TBD')


S = input()
T = '2019/05/01'
print('Heisei' if S < T else 'TBD')