s = raw_input()
y,m,d = map(int, s.split('/'))

def f(y,m,d):
	if m < 4: return True
	if m == 4 and d <= 30: return True
	return False
print 'Heisei' if f(y,m,d) else 'TBD' s = raw_input() s raw_input() raw_input y,m,d = map(int, s.split('/')) y map(int, s.split('/')) map int s.split('/') s.split s split '/' m d def f(y,m,d):
	if m < 4: return True
	if m == 4 and d <= 30: return True
	return False f if m < 4: return True
	 m < 4 m 4 if m == 4 and d <= 30: return True
	 m == 4 and d <= 30 m == 4 m 4 d <= 30 d 30 return False False y y m m d d print 'Heisei' if f(y,m,d) else 'TBD' f(y,m,d) f y m d 'Heisei' 'TBD' m,d = map(int, s.split('/')) map(int, s.split('/')) m y,m,d = map(int, s.split('/')) map(int, s.split('/')) y s = raw_input() raw_input() s def f(y,m,d):
	if m < 4: return True
	if m == 4 and d <= 30: return True
	return False def f(y,m,d):
	if m < 4: return True
	if m == 4 and d <= 30: return True
	return False f d = map(int, s.split('/')) map(int, s.split('/')) d
s = raw_input()
y,m,d = map(int, s.split('/'))

def f(y,m,d):
	if m < 4: return True
	if m == 4 and d <= 30: return True
	return False
print 'Heisei' if f(y,m,d) else 'TBD'