Buggy python submission (verdict: Runtime Error):
a, b, q = map(int, input().split())
sno = [-10e6] + [int(input()) for _ in range(a)] + [10e6]
tno = [-10e6] + [int(input()) for _ in range(b)] + [10e6]
dis = [int(input()) for _ in range(q)]
 
for i in range(q):
 
    sl = 0
    sr = 0
    tl = 0
    tr = 0
 
    for j in range(a+2):
        if sno[j] >= dis[i]:
            sl = dis[i] - sno[j-1]
            sr = sno[j] - dis[i]
            break
        else:
            pass
 
    for k in range(b+2):
        if tno[k] >= dis[i]:
            tl = dis[i] - tno[k-1]
            tr = tno[k] - dis[i]
            break
        else:
            pass
 
    lds = max(sl, tl)
    rds = max(sr, tr)
    ans = min(lds, rds)
    print(ans)

Fixed submission:
date = input()
tdate=[]
 
for s in date:
  tdate.append(s)
  
if tdate[5] != "0":
  mon = int(tdate[5] + tdate[6])
else:
  mon = int(tdate[6])


if mon <= 4:
  print("Heisei")
else:
  print("TBD")

Buggy python submission (verdict: Runtime Error):
a, b, q = map(int, input().split())
sno = [-10e6] + [int(input()) for _ in range(a)] + [10e6]
tno = [-10e6] + [int(input()) for _ in range(b)] + [10e6]
dis = [int(input()) for _ in range q]

for i in range(q):
 
    sl = 0
    sr = 0
    tl = 0
    tr = 0
 
    for j in range(a+2):
        if sno[j] >= dis[i]:
            sl = dis[i] - sno[j-1]
            sr = sno[j] - dis[i]
            break
        else:
            pass
 
    for k in range(b+2):
        if tno[k] >= dis[i]:
            tl = dis[i] - tno[k-1]
            tr = tno[k] - dis[i]
            break
        else:
            pass
 
    lds = max(sl, tl)
    rds = max(sr, tr)
    ans = min(lds, rds)
    print(ans)

Fixed submission:
date = input()
tdate=[]
 
for s in date:
  tdate.append(s)
  
if tdate[5] != "0":
  mon = int(tdate[5] + tdate[6])
else:
  mon = int(tdate[6])


if mon <= 4:
  print("Heisei")
else:
  print("TBD")

Buggy python submission (verdict: Runtime Error):
a, b, q = map(int, input().split())
sno = []
tno = []
dis = []
 
for i in range(a):
  sno.append(int(input()))
sno.append(10000)
 
for i in range(b):
  tno.append(int(input()))
tno.append(10000)
 
for i in range(q):
  dis.append(int(input()))
 
for i in range(q):
  sl = 0
  sr = 0
  tl = 0
  tr = 0
  
  for j in range(a):
    if sno[j] <= dis[i]:
      sl = dis[i] - sno[j]
      sr = sno[j+1] - dis[i]
      break
    else:
      pass
                
  for k in range(b):
    if tno[k] <= dis[i]:
      tl = dis[i] - tno[k]
      tr = tno[k+1] - dis[i]
      break
    else:
      pass
  
  lds = max(sl, tl)
  rds = max(sr, tr)
  dis = min(lds, rds)
  print(dis)

Fixed submission:
date = input()
tdate=[]
 
for s in date:
  tdate.append(s)
  
if tdate[5] != "0":
  mon = int(tdate[5] + tdate[6])
else:
  mon = int(tdate[6])


if mon <= 4:
  print("Heisei")
else:
  print("TBD")

Buggy python submission (verdict: Runtime Error):
a, b, q = map(int, input().split())
sno = []
tno = []
dis = []
 
for i in range(a):
  sno.append(int(input()))
sno.append(10000)
 
for i in range(b):
  tno.append(int(input()))
tno.append(10000)
  
for i in range(q):
  dis.append(int(input()))

for i in range(q):
  sl = 0
  sr = 0
  tl = 0
  tr = 0
  
  for j in range(a):
    if sno[j] <= dis[i]:
      sl = dis[i] - sno[j]
      sr = sno[j+1] - dis[i]
      break
    else:
      pass
    
  for k in range(b):
    if tno[k] <= dis[i]:
      tl = dis[i] - tno[k]
      tr = tno[k+1] - dis[i]
      break
    else:
      pass
  
  lds = max(sl, tl)
  rds = max(sr, tr)
  dis = min(lds, rds)
  print(dis)


Fixed submission:
date = input()
tdate=[]
 
for s in date:
  tdate.append(s)
  
if tdate[5] != "0":
  mon = int(tdate[5] + tdate[6])
else:
  mon = int(tdate[6])


if mon <= 4:
  print("Heisei")
else:
  print("TBD")

Buggy python submission (verdict: Runtime Error):
date = input()
tdate=[]
 
for s in date:
  tdate.insert[s]
  
if tdate[5] != "0":
  mon = int(tdate[5] + tdate[6])
else:
  mon = int(tdate[6])
 
if mon <= 4:
  print("Heisei")
else:
  print("TBD")

Fixed submission:
date = input()
tdate=[]
 
for s in date:
  tdate.append(s)
  
if tdate[5] != "0":
  mon = int(tdate[5] + tdate[6])
else:
  mon = int(tdate[6])


if mon <= 4:
  print("Heisei")
else:
  print("TBD")

Buggy python submission (verdict: Runtime Error):
date = input()
tdate=()
 
for s in date:
  tdate.insert(s)
  
if tdate(5) != "0":
  mon = int(tdate(5) + tdate(6))
else:
  mon = int(tdate(6))
 
if mon <= 4:
  print("Heisei")
else:
  print("TBD")

Fixed submission:
date = input()
tdate=[]
 
for s in date:
  tdate.append(s)
  
if tdate[5] != "0":
  mon = int(tdate[5] + tdate[6])
else:
  mon = int(tdate[6])


if mon <= 4:
  print("Heisei")
else:
  print("TBD")

Buggy python submission (verdict: Runtime Error):
date = input()
tdate=()
 
for s in date:
  tdate.insert(s)
  
if tdate(5) != 0:
  mon = int(tdate(5) + tdate(6))
else:
  mon = int(tdate(6))
 
if mon <= 4:
  print("Heisei")
else:
  print("TBD")

Fixed submission:
date = input()
tdate=[]
 
for s in date:
  tdate.append(s)
  
if tdate[5] != "0":
  mon = int(tdate[5] + tdate[6])
else:
  mon = int(tdate[6])


if mon <= 4:
  print("Heisei")
else:
  print("TBD")

Buggy python submission (verdict: Runtime Error):
date = input()
tdate=()

for s in date:
  ldate.insert(s)

#syr = none
#for i in range(4):
#  syr = syr + ldate(i)
#yer = int(syr)

if ldate(5) != 0:
  mon = int(ldate(5) + ldate(6))
else:
  mon = int(ldate(6))

#if ldate(8) != 0:
#  mon = int(ldate(8) + ldate(9))
#else:
#  mon = int(ldate(9))
  
if mon <= 4:
  print("Heisei")
else:
  print("TBD")

Fixed submission:
date = input()
tdate=[]
 
for s in date:
  tdate.append(s)
  
if tdate[5] != "0":
  mon = int(tdate[5] + tdate[6])
else:
  mon = int(tdate[6])


if mon <= 4:
  print("Heisei")
else:
  print("TBD")