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 (Python):

import sys






"""Template"""


class IP:
    """
    入力を取得するクラス
    """

    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        """
        Half enumeration
        半分全列挙です
        pの要素の和の組み合わせを作ります。
        ソート、重複削除行います
        :param p: list : 元となるリスト
        :return: list : 組み合わせられた和のリスト
        """
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        """
        bit_full_search2
        bit全探索の改良版
        全探索させたら2進数のリストと10進数のリストを返す
        :return: list２つ : １個目 2進数(16桁)  2個目 10進数
        """
        
        
        
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    """右からj+1番目のiが1かどうか判定"""
                    
                    output.append(a[j])
            value.append([format(i, 'b').zfill(16), sum(output)])

        value.sort(key=lambda x: x[1])
        bin = [value[k][0] for k in range(len(value))]
        val = [value[k][1] for k in range(len(value))]
        return bin, val

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def bit_n(self, a, b):
        """
        bit探索で使います。0以上のときにTrue出します
        自然数だからn
        :param a: int
        :param b: int
        :return: bool
        """
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        """
        bit探索で使います。1のときにTrue出すよ
        oneで1
        :param a: int
        :param b: int
        :return: bool
        """
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x // y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)

    def gcd(self, x, y):
        if y == 0:
            return x
        else:
            return self.gcd(y, x % y)


"""ここからメインコード"""


def main():
    
    r, e = range, enumerate
    ip = IP()
    id = Idea()

    """この下から書いてね"""
    s = ip.S()
    y = int(s[0:4])
    m = int(s[5:7])
    d = int(s[8:10])

    if y <= 2019:
        if m <= 4:
            if d <= 30:
                print("Heisei")
            else:
                print("TBD")
        else:
            print("TBD")
    else:
        print("TBD")


main()

Solution (Python):
s = input()
y = int(s[:4])
m = s[5:7]
if m[0] == "0":
    m = int(m[1])
else:
    m = int(m)
d = int(s[8:])

state = True

if y > 2019:
    state = False
elif y == 2019:
    if m > 4:
        state = False
if state:
    print("Heisei")
else:
    print("TBD")

Solution (Python):
S=list(map(int,input().split('/')))

if S[0]<2019:
  print('Heisei')
elif S[0]==2019 and S[1]<=4:
  print('Heisei')
else:
  print('TBD')

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

Solution (Python):
a=input()
aa=a.split('/')
year=int(aa[0])
month=int(aa[1])
day=int(aa[2])
judge=0
if year<2019:
    judge=0
elif year>2019:
    judge=1
else:
    if month>4:
        judge=1
    else:
        judge=0

if judge==1:
    print('TBD')
else:
    print('Heisei')

Solution (Python):
s = input()

m = s[5:7]

if int(m) <= 4:
  print('Heisei')
  
else:
  print('TBD')

Solution (Python):

def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()
s=input().split("/")
s=s[0]+s[1]+s[2]
s=int(s)
if s<=20190430:
    print("Heisei")
else:
    print("TBD")

Solution (Python):




def main():
  year, month, _ = map(int, input().split('/'))
  ans = 'TBD'

  if year < 2019 or (year == 2019 and month <= 4):
    ans = 'Heisei'

  print(ans, flush=True)


if __name__ == '__main__':
  main()

Solution (Python):
s = input()
if s <= "2019/04/30":
  print("Heisei")
else:
  print("TBD")

Solution (Python):
a, b, c = map(int, input().split('/'))
print('TBD' if (a > 2019 or (a == 2019 and b > 4)) else 'Heisei')

Solution (Python):
y, m, d = map(int, input().split('/'))

ans = "Heisei"

if y == 2019 and m > 4 or y > 2019:
    ans = "TBD"

print(ans)

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

Solution (Python):

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

Solution (Python):
S = input()

year = int(S[:4])
if year > 2019:
    print('TBD')
elif year == 2019:
    month = int(S[5:7])
    if month > 4:
        print('TBD')
    else:
        print('Heisei')
else:
    print('Heisei')

Solution (Python):
def solve():
    S = input().split('/')
    S = [int(i) for i in S]
    if(S[0]<2019):
        return (print('Heisei'))
    elif(S[0]>2019):
        return (print('TBD'))
    elif(S[0]==2019 and S[1]>=5):
        return (print('TBD'))
    else:
        return (print('Heisei'))
solve()

Solution (Python):
from sys import stdin
N=(stdin.readline().rstrip())
if int(N.replace("/","")) > 20190430:
  print("TBD")
else:
  print("Heisei")

Solution (Python):
(year, month, date) = map(int, input().split('/'))
print("Heisei" if 4 >= month else "TBD")

Solution (Python):
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')

Solution (Python):
S = raw_input().split("/")
if int(S[1]) >= 5:
  print "TBD"
else:
  print "Heisei"

Solution (Python):
import datetime
raw = input()
date_formatted = datetime.datetime.strptime(raw, "%Y/%m/%d")
if date_formatted <= datetime.datetime(2019, 4, 30):
    print("Heisei")
else:
    print("TBD")

Solution (Python):
if input() <= '2019/04/30':
    print('Heisei')
else:
    print('TBD')

Solution (Python):
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    S = input_raw[0]
    [y, m, d] = S.split("/")
    x = int(m)* 100 + int(d)
    if x <= 430:
        print "Heisei"
    else:
        print "TBD"
if __name__ == '__main__':
    main()

Solution (Python):
TH = 20190430

inp = int("".join(input().split('/')))

if inp <= TH:
    print('Heisei')
else:
    print('TBD')

Solution (Python):

"""
Created on Sat Feb 16 20:52:46 2019

@author: Owner
"""


import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter
import itertools
import copy


def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   

def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())
    
all(nstr.count(c) for c in '753')


ABT = zip(A, B, totAB)
result = 0

sorted(ABT,key=itemgetter(2))
A, B, totAB = zip(*ABT)
A.sort(reverse=True)


(x >> i) & 1


dp = [np.inf]*N
for n in range(N):
    if n == 0:
        dp[n] = 0
    else:
        for k in range(1,K+1):
            if n-k >= 0:
                dp[n] = min(dp[n], dp[n-k] + abs(h[n]-h[n-k]))
            else:
                break

"""

S = input()
T = S.split('/')

date = int(T[1]+T[2])
if date <= 430:
    print('Heisei')
else:
    print('TBD')

Solution (Python):
from datetime import datetime as dt
start = dt.strptime(input(), '%Y/%m/%d')
print('TBD' if start > dt.strptime("2019/04/30", '%Y/%m/%d') else 'Heisei')

Solution (Python):
y, m, d = [int(elem) for elem in input().split("/")]

if y == 2019 and m < 5 and d < 31:
    print("Heisei")
elif y < 2019:
    print("Heisei")    
else:
    print("TBD")

Solution (Python):



import datetime


F = "%Y/%m/%d"
C = "2019/04/30"


def str2date(s):
    return datetime.datetime.strptime(s, F)


def is_heisei(s):
    d0 = str2date(C)
    d1 = str2date(s)
    return d1 <= d0


def main():
    print("Heisei" if is_heisei(input()) else "TBD")


if __name__ == "__main__":
    main()

Solution (Python):
import sys
 
v = ""
for line in sys.stdin:
    v = [int(i) for i in line.split("/")]
 
if v[0] < 2019:
  print("Heisei")
elif v[0] == 2019 and v[1] <= 4 and v[2] <= 30:
  print("Heisei")
else:
  print("TBD")

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

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

Solution (Python):
s = input()
year = int(s[0:4])
month = int(s[5:7])
day = int(s[8:10])
if year < 2019:
    print('Heisei')
elif year == 2019 and month < 4:
    print('Heisei')
elif year == 2019 and month == 4 and day < 31:
    print('Heisei')
else:
    print('TBD')

Solution (Python):
S = input()

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

Solution (Python):
y,m,d = map(int,input().split('/'))

if y<2019:
    print('Heisei')
elif 2019<y:
    print('TBD')
else:
    if m<4:
        print('Heisei')
    elif 4<m:
        print('TBD')
    else:  
        if d<=30:
            print('Heisei')
        else:
            print('TBD')

Solution (Python):
s=input()
if int(s[5])==1 or int(s[6])>=5 :
    print("TBD")
else:
    print('Heisei')

Solution (Python):

S = input()
res = (int(S[5:7]) <= 4)
    
def print_answer(res):
    if res:
        print("Heisei")
    else:
        print("TBD")
print_answer(res)

Solution (Python):
import datetime
date_str = input()
heisei_str = "2019/04/30"
date_formatted = datetime.datetime.strptime(date_str, "%Y/%m/%d")
date_formatted_heisei = datetime.datetime.strptime(heisei_str, "%Y/%m/%d")

if date_formatted <= date_formatted_heisei :
    print("Heisei")
else :
    print("TBD")

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

Solution (Python):
s=list(map(int, input().split("/")))
if s[0]==2019:
  if s[1]<=4:
    if s[2]<=30:
      print("Heisei")
      exit()
if s[0]<2019:
  print("Hesisei")
  exit()
print("TBD")

Solution (Python):
s = input().split('/')
y, m, d = map(int, s)

if y <= 2018:
    print('Heisei')
elif y == 2019:
    if m <= 4:
        print('Heisei')
    else:
        print('TBD')
else:
    print('TBD')

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

Solution (Python):



















from collections import defaultdict, Counter
import math
from bisect import bisect_left, bisect_right
import numpy as np

S = input()

year = int(S[:4])
month = int(S[5:7])
day = int(S[8:])

if year >= 2019:
    if month > 4:
        print("TBD")
    else:
        print("Heisei")
else:
    print("Heisei")

Solution (Python):

import math
import sys

s = str(sys.stdin.readline().rstrip())
s = s.split("/")
s_n = int(s[0])*10000 + int(s[1])*100 + int(s[2])

if s_n <= 20190430:
  print("Heisei")
else:
  print("TBD")

Solution (Python):
s = input()
year = int(s[0:4])
month = int(s[5:7])
day = int(s[8:10])

if year < 2019:
    print('Heisei')
elif year == 2019:
    if month < 4:
        print('Heisei')
    elif month == 4:
        print('Heisei')
    else:
        print('TBD')
else:
    print('TBD')

Solution (Python):
s=input()
y=int(s[0:4])
m=int(s[5:7])
d=int(s[8:10])

if y<=2018:
    print("Heisei")
elif y==2019 and m<=4:
    print("Heisei")
else:
    print("TBD")

Solution (Python):
S = str(input())
slist=list(S)
year=""
mon=""
day=""
for i in range(10):
    if i < 4: 
        year+=slist[i]
    elif i < 7 and i!=4:
        mon+=slist[i]
    elif i < 10 and i!=4 and i!=7:
        day+=slist[i]
if int(year) <= 2019:
    if int(mon) <= 4:
        if int(day) <= 30:
            print("Heisei")
        else:
            print("TBD")
    else:
        print("TBD")
else:
    print("TBD")

Solution (Python):
y,m,d = map(int, input().split('/'))

result = 'TBD'

if y<=2018:
    result='Heisei'
elif y==2019:
    if m<=3:
        result='Heisei'
    elif m==4:
        if d<=30:
            result='Heisei'

print(result)

Solution (Python):
s_list = list(map(int, input().split('/')))
if s_list[0] >= 2019 and s_list[1] >= 5:
    print('TBD')
else:
    print('Heisei')

Solution (Python):




yes = 'Heisei'
no = 'TBD'

def main():
    y, m, d = map(int, input().split('/'))
    if y < 2019:
        print(yes)
        return
    if y == 2019:
        if m <= 4:
            print(yes)
            return
    print(no)


if __name__ == '__main__':
    main()

Solution (Python):
s = input()

m = int(s[5:7])
d = int(s[8:11])

if m >= 5:
    print('TBD')
else:
    print('Heisei')

Solution (Python):
s = input()
y = int(s[:4])
m = int(s[5:7])
d = int(s[8:10])

if y < 2019:
    print("Heisei")
elif m <= 4:
    print("Heisei")
else:
    print("TBD")

Solution (Python):
S = input()
y, m, d = map(int, S.split("/"))

H = False
if y <= 2018:
    H = True
if y == 2019:
    if m <= 4:
        H = True

print(["TBD", "Heisei"][H])

Solution (Python):
s=input()

s_date = list(map(int,s.split('/')))

if s_date[0] <= 2019 and s_date[1] <= 4 and s_date[2] <= 30:
    print('Heisei')
else:
    print('TBD')

Solution (Python):
from datetime import datetime, timedelta

def main():
    s = input()
    d = datetime.strptime(s, '%Y/%m/%d')
    if d < datetime(2019, 4, 30) + timedelta(days=1):
        print('Heisei')
    else:
        print('TBD')

if __name__ == "__main__":
    main()

Solution (Python):
from datetime import datetime
s = input()
date_dt = datetime.strptime(s, '%Y/%m/%d')
if date_dt <= datetime(2019, 4, 30):
  print("Heisei")
else :
  print("TBD")

Solution (Python):
import sys

def main(inp):
    y,m,d=map(int,next(inp).split("/"))
    
    if(m<=4): return """Heisei
"""
    else: return """TBD
"""
    
print(main(sys.stdin))

Solution (Python):
S = input()
y, m, d = int(S[:4]), int(S[5:7]), int(S[8:])
H, T = 'Heisei', 'TBD'
if y < 2019:
    print(H)
elif y > 2019:
    print(T)
else:  
    if m < 4:
        print(H)
    elif m > 4:
        print(T)
    else:
        print(H)

Solution (Python):
s = list(map(int, input().split('/')))
if s[1] < 4 or (s[1] == 4 and s[2] <= 30):
    print('Heisei')
else:
    print('TBD')

Solution (Python):
import datetime
s =datetime.datetime.strptime(input(), '%Y/%m/%d')

if s<=datetime.datetime(2019,4,30,0,0,0):
    print('Heisei')
else:
    print('TBD')

Solution (Python):
S=input()

year=int(S[0:4])
month=int(S[5:7])
if year<2019:
  print('Heisei')
elif year>2019:
  print('TBD')
else:
  if month<=4:
    print('Heisei')
  elif month>4:
    print('TBD')

Solution (Python):
S = list(map(int,input().split("/")))
if S[0] < 2019:
    print("Heisei")
elif S[0] == 2019 and S[1] < 4:
    print("Heisei")
elif S[0] == 2019 and S[1] == 4 and S[2] < 31:
    print("Heisei")
else:
    print("TBD")

Solution (Python):
S = input()
import datetime
date_formatted = datetime.datetime.strptime(S, "%Y/%m/%d")
d = datetime.datetime(2019, 4, 30)
if d < date_formatted:
    print("TBD")
else:
    print("Heisei")

Solution (Python):
S = input()

y = int(S[:4])
m = int(S[5:7])
d = int(S[8:10])

if y > 2019:
    print('TBD')
elif y < 2019:
    print('Heisei')
else:
    if m >= 5:
        print('TBD')
    else:
        print('Heisei')

Solution (Python):
s = str(input())

day = s[-2:]

month = s[5:7]

if int(month) > 4:
    print('TBD')
else:
    if int(day) > 30:
        print('TBD')
    else:
        print('Heisei')

Solution (Python):


import random
import bisect




def IT(): 
    return int(input())
def IL(): 
    return [int(_) for _ in input().split()]
def IS(): 
    return [_ for _ in input().split()]
def ILS(n): 
    return [int(input()) for _ in range(n)]
def SLS(n): 
    return [input() for _ in range(n)]
def ILSS(n): 
    return [[int(_) for _ in input().split()] for j in range(n)]


def bit_full_search(ss):
    n = len(ss)
    for i in range(1 << n):
        s = ""
        for j in range(n + 1):
            if ((1 & i >> j) == 1):
                s += ss[j]
        print(s)
def bit_full_search2(A):
    
    value = []
    for i in range(1 << len(A)):
        output = []

        for j in range(len(A)):
            if ((i >> j) & 1) == 1:
                
                output.append(A[j])
        value.append([format(i, 'b').zfill(16), sum(output)])

    value.sort(key=lambda x:x[1])
    bin = [value[k][0] for k in range(len(value))]
    val = [value[k][1] for k in range(len(value))]
    return bin, val
def matching_bisect(list1_val, list2_val, n):
    
    j = 0
    for i in range(len(list1_val)):
        j = bisect.bisect_left(list2_val, n - list1_val[i])
        if j < len(list2_val):
            if list1_val[i] + list2_val[j] == n:
                
                break
    return j

"""ここからメインコード"""


def main():
    s = input()
    year = int(s[0:4])
    month = int(s[5:7])
    day = int(s[8:10])

    if year < 2019:
        print("Heisei")
    elif year > 2019:
        print("TBD")
    else:
        if month <= 4:
            print("Heisei")
        else:
            print("TBD")



main()

Solution (Python):
import sys
input = sys.stdin.readline

def main():
	Y, M, D = map(int, input().split('/'))
	if Y < 2019 or (M <= 4 and D <= 30):
		print("Heisei")
	else:
		if Y == 2019:
			if M >= 5:
				print("TBD")
			else:
				print("Heisei")
		else:
			print("TBD")

if __name__ == '__main__':
	main()

Solution (Python):


y, m, d = map(int, input().split("/"))

heisei = True
if y < 2019:
    heisei = True
elif y == 2019:
    if m < 4:
        heisei = True
    elif m == 4:
        if d <= 30:
            heisei = True
        else:
            heisei = False
    else:
        heisei = False
else:
    heisei = False

if heisei is True:
    print("Heisei")
else:
    print("TBD")

Solution (Python):
S = list(input().split("/"))
S[0] = int(S[0])
S[1] = int(S[1])
S[2] = int(S[2])

ans = "Heisei"

if (S[0] >= 2019) :
    if S[1] >= 5 :
        ans = "TBD"
    elif S[1] == 4 :
        if S[2] == 31 :
            ans = "TBD"
print(ans)

Solution (Python):
Y, M, D = map(int, input().split('/'))

tbd = False

if Y > 2019:
    tbd = True

elif Y < 2019:
    tbd = False

elif M <= 4:
    tbd = False

else:
    tbd = True

print('TBD' if tbd else 'Heisei')

Solution (Python):
s=str(input())
y=int(s[0:4])
m=int(s[5:7])
d=int(s[8:])

if y <=2018:
    print("Heisei")
elif y >=2020:
    print("TBD")
elif m<=3:
    print("Heisei")
elif m>=5:
    print("TBD")
else:
    if d<=30:
        print("Heisei")
    else:
        print("TBD")

Solution (Python):
S=input()

S_l=S.split('/')

if int(S_l[1])>4:
       print('TBD')
else:
       print('Heisei')

Solution (Python):

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

Solution (Python):
s = input()
a = list(map(int, s.split("/")))
if a[0] > 2019:
    print("TBD")
elif a[0]<2019:
    print('Heisei')
elif a[1] < 5:
    print("Heisei")
else:
    print("TBD")

Solution (Python):
s = input()
y = int(s[:4])
m = int(s[5:7])
d = int(s[8:])

if m < 5:
    print('Heisei')
else:
    print('TBD')

Solution (Python):
data = input().split("/")
Y = int(data[0])
M = int(data[1])
D = int(data[2])
if Y > 2019 or (Y == 2019 and M > 4) or (Y == 2019 and M == 4 and D > 30):
    print("TBD")
else:
    print("Heisei")

Solution (Python):
S = input()

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

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
S = input()

l = S.split("/")

ans = "Heisei"
if int(l[0]) > 2019:
    ans = "TBD"
elif l[0] == "2019":
    if int(l[1]) > 4:
        ans = "TBD"
print(ans)

Solution (Python):
y, m, d = map(int, input().split("/"))
if y >= 2020:
    print("TBD")
elif y <= 2018:
    print("Heisei")
elif m >= 5:
    print("TBD")
else:
    print("Heisei")

Solution (Python):
from sys import stdin

y, m, d = [int(x) for x in stdin.readline().rstrip().split('/')]
if m <= 4:
    print('Heisei')
else:
    print('TBD')

Solution (Python):
y, m, d = map(int, input().split('/'))

if y >= 2019 and m >= 5:
    print('TBD')
else:
    print('Heisei')

Solution (Python):
import datetime

s=str(input())

date_dt = datetime.datetime.strptime(s, '%Y/%m/%d')
if date_dt > datetime.datetime(2019,4,30):
  print("TBD")
else:
  print("Heisei")

Solution (Python):
S = input()

if int(S[0:4]) <= 2019 and int(S[5:7]) <= 4 and int(S[8:10]) <= 30:
    print("Heisei")
else:
    print("TBD")

Solution (Python):
y,m,d = input().split('/')

y = int(y)
m = int(m)
d = int(d)

if y <= 2019:
    if m <= 4:
        if d <= 30:
            print('Heisei')
            exit()

print('TBD')

Solution (Python):
S = input().split("/")
S = [int(e) for e in S]
if S[0] > 2019:
    print("TBD")
    exit()
if S[1] > 4:
    print("TBD")
    exit()
if S[2] > 30:
    print("TBD")
    exit()
print("Heisei")

Solution (Python):
a = list(map(int,input().split("/")))
x = int(a[0])*10000+int(a[1])*100+int(a[2])
if x <= 20190430:
  print("Heisei")
else:
  print("TBD")

Solution (Python):
s = input()
y = int(s[:4])
m = int(s[5:7])
d = int(s[8:10])

if (y<2019) | ((y==2019)&(m<4)) | ((y==2019)&(m==4)&(d<=30)):
    print('Heisei')
else:
    print('TBD')

Solution (Python):
from datetime import datetime

S = input()

year, month, day = map(int, S.split("/"))

print(["TBD", "Heisei"][datetime(year, month, day)<=datetime(2019, 4, 30)])

Solution (Python):
import datetime
S = input()
date = datetime.datetime.strptime(S, "%Y/%m/%d")
if date > datetime.datetime(2019, 4, 30):
    print("TBD")
else:
    print("Heisei")

Solution (Python):
Y,M,D=map(int,input().split('/'))

f =False 

if Y < 2019:
	f = True
if Y <= 2019:
	if M <= 4:
		f = True

if f:
	print("Heisei")
else:
	print("TBD")

Solution (Python):
S = input()

import datetime
he = datetime.datetime(2019, 4, 30)
ta = datetime.datetime.strptime(S, '%Y/%m/%d')

if he < ta:
    print("TBD")
else:
    print("Heisei")

Solution (Python):
Y,M,D=map(int,raw_input().split('/'))



if Y < 2019:
    print 'Heisei'
elif M < 5:
    print 'Heisei'
else:
    print 'TBD'

Solution (Python):
y,m,d=map(int,input().split("/"))
h="Heisei"
t="TBD"
if y<2019:
  print(h)
elif y==2019:
  if m<=4:
    print(h)
  else:
    print(t)
else:
  print(t)

Solution (Python):
S = input()
if int(S[0:4])>2019:
    print("TBD")
elif int(S[0:4])<2019:
    print("Heisei")
elif int(S[5:7])>4:
    print("TBD")
else:
    print("Heisei")

Solution (Python):
year,month,day = map(int,input().split('/'))
if year < 2019:
    print('Heisei')
elif year > 2019:
    print('TBD')
else:
    if month>= 5:
        print('TBD')
    else:
        print('Heisei')

Solution (Python):
import sys





S = str(input())

if(int(S[6]) +int(S[5])*10  > 4 or (int(S[6]) == 4 and int(S[8])*10 +int(S[9])  > 30 ) ):
    print("TBD")
else:
    print("Heisei")

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

Solution (Python):
import sys
input = sys.stdin.readline
s = input()
if int(s[:4]) < 2019:
    print("Heisei")
elif int(s[:4]) == 2019 and int(s[5:7]) <= 4:
    print("Heisei")
else:
    print("TBD")

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

Solution (Python):
S = input()

if int(S[:4]) > 2019:
    print('TBD')
elif int(S[:4]) < 2019:
    print('Heisei')
elif int(S[:4]) == 2019:
    if int(S[5:7]+S[8:]) <= 430:
        print('Heisei')
    else:
        print('TBD')

Solution (Python):

row_str = input()
data = row_str.split('/')

hiduke = [int(d) for d in data]

if hiduke[1] <= 4 and hiduke[2] <= 30:
	print("Heisei")
else:
	print("TBD")

Solution (Python):
date = input().split("/")


if int(date[1]) >= 5:
    print("TBD")
else:
    print("Heisei")

Solution (Python):
S = input()

y = int(S[:4])
m = int(S[5:7])
d = int(S[8:])

str = "TBD"

if y < 2019:
  str = "Heisei"
elif y == 2019:
  if m <= 4:
    str = "Heisei"

print(str)

Solution (Python):
s = input()

si = int(s.replace('/', ''))

if si <= 20190430:
    print('Heisei')
else:
    print('TBD')

Solution (Python):
a, b, c = [int(i) for i in input().split("/")]

if a>2019:
    print("TBD")
elif a<2019:
    print("Heisei")
elif b>4:
    print("TBD")
else:
    print("Heisei")

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

Solution (Python):
S=input()
a=S[:4]
b=S[5:7]
c=S[8:10]

d=int(a+b+c)

print("Heisei" if d<=20190430 else "TBD")

Solution (Python):
S = list(map(int, input().split('/')))
if S[0] < 2018 or S[0] == 2019 and S[1] < 5:
  print("Heisei")
else:
  print("TBD")

Solution (Python):


Y, M, D = map(int, input().split('/'))

if Y == 2019:
    if M == 4:
        if D <= 30:
            print('Heisei')
        else:
            print('TBD')
    elif M > 4:
        print('TBD')
    elif M < 4:
        print('Heisei')
elif Y > 2019:
    print('TBD')
elif Y < 2019:
    print('Heisei')

Solution (Python):
S = input().split('/')
t=int(S[0]+S[1]+S[2])

if t>20190430:
    print('TBD')
else:
    print('Heisei')

Solution (Python):
y, m, d = input().split("/")
if int(y) < 2019:
    print("TBD")
elif int(m) > 4:
    print("TBD")
else:
    print("Heisei")

Solution (Python):
y, m, d = map(int, input().split('/'))

ans = 'Heisei'
if y >= 2019:
    if m > 4:
        ans = 'TBD'

print(ans)

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

Solution (Python):
S = input()
s = S.split('/')
s2 = int(s[0] + s[1] + s[2])
if s2 <= 20190430:
    print("Heisei")
else:
    print("TBD")

Solution (Python):
[s] = [i for i in input().split()]

year, month, day = s.split('/')
if int(year) > 2019 or (int(year) == 2019 and int(month) > 4):
    print("TBD")
else:
    print ("Heisei")

Solution (Python):
s=list(map(int,input().split("/")))
if(s[0]<=2019 and s[1]<=4):
    print("Heisei")
else:
    print("TBD")

Solution (Python):
from sys import stdin

def main():
    S = input()

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

input = lambda: stdin.readline().rstrip()
main()

Solution (Python):
d = [int(v) for v in input().split("/")]

if d[1] <= 4:
  print("Heisei")
else:
  print("TBD")

Solution (Python):


def main():
	x,y,z = map(int, raw_input().split("/"))
	if x>2019 or x==2019 and y>4 or x==2019 and y==4 and z>31:
		print "TBD"
	else:
		print "Heisei"
	
	return 0

if __name__ == '__main__':
	main()

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

Solution (Python):
S = list(map(int, input().split('/')))

def main():
    if S[0]>2019:
        print('TBD')
        return
    elif S[0]==2019 and S[1]>4:
        print('TBD')
        return
    else:
        print('Heisei')
        return 

main()

Solution (Python):
S = input().split('/')
if( (int(S[1]) <= 4)and(int(S[2]) <= 30)):
   print("Heisei")
else:
   print("TBD")

Solution (Python):



import sys
import math










s = input().split('/')



if int(s[0]) > 2019:
    print('TBD')
    quit()
if int(s[0]) == 2019 and int(s[1]) > 4:
    print('TBD')
    quit()

print('Heisei')

Solution (Python):


s=input()
f=s.split('/')
m=int(f[1])
if m <= 4:
  print('Heisei')
elif m > 4:
  print('TBD')

Solution (Python):
import datetime
S = datetime.datetime.strptime(input(), "%Y/%m/%d")
T = datetime.datetime.strptime("2019/04/30", "%Y/%m/%d")
print("Heisei" if S <= T else "TBD")

Solution (Python):
s = input()
s = s.replace("/","")
if int(s) <= 20190430:
    print("Heisei")
else:
    print("TBD")

Solution (Python):
s = input()
n = int(s[5:7])*100 + int(s[-2:])
if n <= 430:
    print("Heisei")
else:
    print("TBD")

Solution (Python):






def main():
    S = raw_input().strip()
    

    d = [int(n) for n in S.split('/')]
    if d[1] >= 5:
        print 'TBD'
    else:
        print 'Heisei'


if __name__ == '__main__':
    main()

Solution (Python):
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools

def j(q):
    if q==1: print("Heisei")
    else:print("TBD")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())

def swap(s,pos):
    s[pos]-=1
    s[pos+1]+=1
    print(s)
    if pos == n-2: return s
    if s[pos+2] == 0: swap(s,pos+1)
    return s







a = input()                                  






if (int(a[0:4]) == 2019 and int(a[5:7]) >= 5) or int(a[0:4]) > 2019 :j(0)
j(1)