Harryxun/stf_run huggingface dataset:
count = 0
while True:
    x=input("")
    count+=1
    print("Case ",str(count) + ":", x)

### FIXED CODE ###

t=[]
while True:
    x = str(input(""))
    if x == "0":
        break
    else:
        t.append(x)
for i,v in enumerate(t):
    print("Case",str(i+1)+":",v)
n = int(input())
s = input()

for i in range(n - 2):
    if s[i] == 'A' and s[i + 1] == 'B' and s[i + 2] == 'C':
        count += 1
print(count)


### FIXED CODE ###

n = int(input())
s = input()
count = 0

for i in range(n - 2):
    if s[i] == 'A' and s[i + 1] == 'B' and s[i + 2] == 'C':
        count += 1

print(count)
dp = [[0 for _ in range(10**2+10)] for _ in range(10**5+10)]

N, W = map(int,input().split())
w = []
v = []

for i in range(N):
    wi,vi = map(int,input().split())

    w.append(wi)
    v.append(vi)

for i in range(N):
    for capacity in range(W+1):
        if w[i] > capacity:
            dp[i+1][capacity] = dp[i][capacity]
        else:
            dp[i+1][capacity] = max(dp[i][capacity], dp[i][capacity-w[i]] + v[i])

print(dp[N][W])

### FIXED CODE ###

dp = [[0 for _ in range(10**5+10)] for _ in range(10**2+10)]

N, W = map(int,input().split())
w = []
v = []

for i in range(N):
    wi,vi = map(int,input().split())

    w.append(wi)
    v.append(vi)

for i in range(N):
    for capacity in range(W+1):
        if w[i] > capacity:
            dp[i+1][capacity] = dp[i][capacity]
        else:
            dp[i+1][capacity] = max(dp[i][capacity], dp[i][capacity-w[i]] + v[i])

print(dp[N][W])
n, k = map(int, input().split())
nums = list(map(int, input().split()))
if n <= k:
    print(0)
else:
    for i in range(k):
        nums.pop(max(nums))
    print(sum(nums))

### FIXED CODE ###

n, k = map(int, input().split())
nums = list(map(int, input().split()))
nums.sort()
ans = 0
for i in range(n-k):
    ans += nums[i]
print(ans)
n = int(input())
a = []
for i in range(n):
    _ = list(map(int, input().split()))
    a.append(_)
check = False
for i in range(110):
    for j in range(110):
        b = 0
        while b < n-1:
            if b == 0:
                h = abs(i - a[b][0]) + abs(j - a[b][1]) + a[b][2]
                b +=1
            else:
                de = abs(i - a[b][0]) + abs(j - a[b][1]) + a[b][2]
                if h  == de:
                    b+=1
                else:
                    break
        if b == n-1:
            ans = str(i) + ' ' + str(j) + ' ' +str(h)
            check = True
        if check:
            break
    if check:
        break
print(ans)

### FIXED CODE ###

n = int(input())
a = []
for i in range(n):
    _ = list(map(int, input().split()))
    a.append(_)
a = sorted(a, key=lambda x:x[2],reverse = True)

check = False
    
for i in range(101):
    for j in range(101):
        b = 0
        while b < n:
            if b == 0:
                h = abs(i - a[b][0]) + abs(j - a[b][1]) + a[b][2]
                b +=1
            else:
                de = max(h - abs(i - a[b][0]) - abs(j - a[b][1]),0)
                if de == a[b][2]:
                    b+=1
                else:
                    break
        if b == n:
            ans = str(i) + ' ' + str(j) + ' ' +str(h)
            check = True
        if check:
            break
    if check:
        break
print(ans)
# -*- coding: utf-8 -*-                                                

import os
import sys
import math
import numpy as np

O = input()
E = input()
ans = ''
for i in range(len(E)):
    ans += O[i]
    ans += E[i]

if len(O) != len(E):
    ans += O[-1]

print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-                                                

import os
import sys
import math
import numpy as np

a, b, c = map(int, input().split())
if (b - a) == (c - b):
    print('YES')
else:
    print('NO')
N = int(input())
nums=[int(input()) for _ in range(N)]
MAX = 10*4
dp = [0] * (MAX+1)
dp[0] = 1
for num in nums:
  for i in range(MAX+1)[::-1]:
    if dp[i] == 1 and (i + num) <= MAX*MAX:
      dp[i+num] = 1
ans = 0
for i in range(MAX+1):
  if dp[i] == 1 and i%10 != 0:
    ans = i
print(ans)


### FIXED CODE ###

N = int(input())
INF =101
sum_num = 0
min_num = INF

for _ in range(N):
  num = int(input())
  if num%10 != 0:
    min_num = min(min_num, num)
  sum_num += num
if min_num == INF:
  print(0)
elif sum_num%10 == 0:
  print(sum_num-min_num)
else:
  print(sum_num)
c = 0
while True:
    N = int(raw_input())
    if N == 0:
        break
    if c != 0:
        print ''
        
    dic = {}
    for i in range(N):
        lis = raw_input().split()
        name = lis[0]
        lis = map(int, lis[1:])
        point = lis[0]*3 + lis[2]
        dic[name] = [point, N-i]
    
    for k, v in sorted(dic.items(), key=lambda x: (x[0][0], x[0][1]), reverse=True):
        print '%s,%s' % (k, v[0])
    c = 1

### FIXED CODE ###

N = input()
while True:
    dic = {}
    for i in range(N):
        lis = raw_input().split()
        dic[lis[0]] = [3*int(lis[1])+int(lis[3]), N-i]
    
    for k, v in sorted(dic.items(), key=lambda x: (x[1][0], x[1][1]), reverse=True):
        print '%s,%s' % (k, v[0])

    N = input()
    if N == 0: break
    print
from collections import deque, defaultdict

def topological_sort(V, E):
    indeg = {v: 0 for v in V}
    for ends in E.values():
        for v in ends:
            indeg[v] += 1
    q = deque([v for v in V if indeg[v] == 0])
    top_sorted = []
    while q:
        v = q.popleft()
        top_sorted.append(v)
        for u in E[v]:
            indeg[u] -= 1
            if indeg[u] == 0:
                q.append(u)
    if len(top_sorted) == len(V): # The input digraph is acyclic.
        return top_sorted
    else: # There is a directed cycle in the digraph.
        return top_sorted

N, M = map(int, input().split())
V = list(range(1, N+1))
E1 = defaultdict(list)
E2 = defaultdict(list)
for _ in range(M):
    a, b = map(int, input().split())
    E1[a].append(b)
    E2[b].append(a)
deleted = topological_sort(V, E1)
if len(deleted) == N: print(-1)
else:
    V = list(set(V) - set(deleted))
    deleted = topological_sort(V, E2)
    V = list(set(V) - set(deleted))
    print(len(V))
    print(*V, sep='\n')

### FIXED CODE ###

def cycle_detection(V, E, s):
    prev = [-1] * len(V)
    stack = [s]
    while stack:
        v = stack.pop()
        for u in E[v]:
            if u == s:
                prev[u] = v
                return (s, prev)
            if prev[u] == -1:
                stack.append(u)
                prev[u] = v
    return (-1, prev)

N, M = map(int, input().split())
V = list(range(N))
E = [[] for _ in range(N)]
edges = []
for _ in range(M):
    a, b = map(int, input().split())
    E[a-1].append(b-1)
    edges.append((a-1, b-1))

dag = False
for v in range(N):
    s, prev = cycle_detection(V, E, v)
    if s != -1: break
else:
    dag = True

if dag: print(-1)
else:
    # construct a directed cycle
    cycle = set()
    cycle.add(s)
    pv = prev[s]
    while pv != s:
        cycle.add(pv)
        pv = prev[pv]
    # shrink the directed cycle
    for a, b in edges:
        if a in cycle and b in cycle and prev[b] != a:
            pv = prev[b]
            while pv != a:
                cycle.remove(pv)
                pv = prev[pv]
            prev[b] = a
    print(len(cycle))
    print(*[v + 1 for v in cycle], sep='\n')
# 累積和
n, q = map(int, input().split())
s = input()
arr = [0] * (2 * 10**5 + 10)
idx = 1
while idx <= len(s):
    if s[idx - 1] == "A" and s[idx] == "C":
        arr[idx] += 1
    idx += 1
for i in range(1, len(arr)):
    arr[i] += arr[i - 1]
for _ in range(q):
    l, r = map(int, input().split())
    print(arr[r - 1] - arr[l - 1])


### FIXED CODE ###

n, m = map(int, input().split())
s = input()
imos = [0 for _ in range(n)]
for i in range(1, n):
    if s[i-1] == "A" and s[i] == "C":
        imos[i] = imos[i-1]+1
    else:
        imos[i] = imos[i - 1]
for _ in range(m):
    l, r = map(int, input().split())
    if l > 1:
        print(imos[r-1]-imos[l-1])
    else:
        print(imos[r-1])
,k=map(int,input().split())
a=[]
for x in range(n):
  a.append(int(input()))
ans=1000000009
a=sorted(a)
for y in range(n-k+1):
  ans=min(a[y+k-1]-a[y],ans)
  
print(ans)



### FIXED CODE ###

n,k=map(int,input().split())
a=[]
for x in range(n):
  a.append(int(input()))
ans=1000000009
a=sorted(a)
for y in range(n-k+1):
  ans=min(a[y+k-1]-a[y],ans)
  
print(ans)
import sys
from collections import deque

input = sys.stdin.readline
n, u, v = map(int, input().split())

E = [[] for i in range(n)]
for i in range(n - 1):
    a, b = map(int, input().split())
    E[a-1].append(b-1)
    E[b-1].append(a-1)

memo = [[0, 0] for i in range(n)]

def dfs(cur, pre, dep, p):
    stack = deque([[cur, pre]])
    memo[cur][p] = dep
    while stack:
        cur, pre = stack.pop()
        for e in E[cur]:
            if e != pre:
                dfs(e, cur, dep + 1, p)

dfs(u - 1, - 1, 0, 0)
dfs(v - 1, -1, 0, 1)

# print(memo)
ans = 0
for a, b in memo:
    if b - a > 1:
        ans = max(ans, b - 1)
print(ans)


### FIXED CODE ###

import sys
from collections import deque

input = sys.stdin.readline
n, u, v = map(int, input().split())

E = [[] for i in range(n)]
for i in range(n - 1):
    a, b = map(int, input().split())
    E[a-1].append(b-1)
    E[b-1].append(a-1)

memo = [[0, 0] for i in range(n)]

def dfs(cur, pre, p):
    stack = deque([[cur, pre]])
    while stack:
        cur, pre = stack.pop()
        if pre != -1:
            memo[cur][p] = memo[pre][p] + 1
        for e in E[cur]:
            if e != pre:
                stack.append([e, cur])

dfs(u - 1, - 1, 0)
dfs(v - 1, -1, 1)

# print(memo)
ans = 0
for a, b in memo:
    if a <= b:
        ans = max(ans, b - 1)
print(ans)
N=int(input())
L=[input() for i in range(N)]
M=set(L)
print(len(M))

### FIXED CODE ###

S,W=map(int,input().split())
if S<=W:
  print('unsafe')
else:
  print('safe')
x = map(int,input().split())

W = x[0]
H = x[1]
x = x[2]
y = x[3]
r = x[4]


if 0 <= x-r and x+r <= W:
    if 0 <= y-r and y+r <= H:
        print "Yes"
print "No"

### FIXED CODE ###

m = map(int,raw_input().split())

W = m[0]
H = m[1]
x = m[2]
y = m[3]
r = m[4]


if 0 <= x-r and x+r <= W and 0 <= y-r and y+r <= H:
    print "Yes"
else:
    print "No"
import math

n,k = map(int,input().split())
sum = 0
for i in range(1,n+1) :
    if i > k :
        sum += 1
    else :
        sum += math.pow(0.5,math.ceil(math.log2(k/i)))
print(sum/n)

### FIXED CODE ###

import math

n,k = map(int,input().split())
sum = 0
for i in range(1,n+1) :
    if i > k :
        sum += 1
    else :
        sum += math.pow(0.5,math.ceil(math.log2(k/i)))
print(sum/n)
n = input()
maxv = -1 * 10**9
minv = input()

for j in range(1,n-1):
  v = input()
  if maxv < v - minv:
    maxv = v - minv
  if minv > v
    minv = v

print maxv

### FIXED CODE ###

n = input()
minv = input()
maxv = -1 * 10**9

for j in range(n-1):
  v = input()
  if maxv < v - minv:
    maxv = v - minv
  if minv > v:
    minv = v

print maxv
import math
n = int(input())
x = list(map(int, raw_input().split()))
y = list(map(int, raw_input().split()))
t1 = t2 = t3 = ti = 0.0
for a, b in zip(x, y):
	d1 = abs(a - b)
	ti = max(ti, d1)
	t1 += d1
	t2 += d1**2
	t3 += d1**3
print(t1)
print(math.sqrt(t2))
print(t3 ** (1.0/3))
print(ti)

### FIXED CODE ###


import math
n = int(input())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
t1 = t2 = t3 = ti = 0.0
for a, b in zip(x, y):
	d1 = abs(a - b)
	ti = max(ti, d1)
	t1 += d1
	t2 += d1**2
	t3 += d1**3
print(t1)
print(math.sqrt(t2))
print(t3 ** (1.0/3))
print(ti)
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math

# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
 
def main():
    N = int(input())
    A = input().split()
    
    ans = []
    hafe = N // 2
    for i in range(N, 0, -1):
        if i >= hafe:
            if A[i-1] == "1":
                ans.append(i)
            continue
            
        cons = 0
        '''
        for j in range(i, N+1, i):
            if j in ans:
                cons += 1
        if A[i-1] == "1" and cons % 2 == 0:
            ans.append(i)
            continue
        if A[i-1] == "0" and cons % 2 == 1:
            ans.append(i)
            continue
            '''
            
    print(len(ans))
    if len(ans) != 0:
        anss = ""
        for i in ans:
            anss = anss + str(i) + " "
        
            print(anss[:-1])
            	
if __name__ == "__main__":
	main()


### FIXED CODE ###

import sys
 
def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7
 
N=INT()
A=LIST()
 
# その位置にボールを入れるかを保持するA2
A2=[0]*N
B=[]
# 後ろから決めていく
for i in range(N-1, -1, -1):
    cur=i+1
    cnt=0
    # curの倍数を全部見に行く
    for j in range(cur*2, N+1, cur):
        cnt^=A2[j-1]
    # ボールを入れるべきかどうか
    if A[i]!=cnt:
        B.append(cur)
        A2[i]=1
 
print(len(B))
print(*B)
# ABC141d
import sys
import heapq
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

a, b = map(int, input().split())
cd = []
for i in range(1, math.gcd(a, b) + 1):
    if (a % i != 0 or b % i != 0):
        continue
    flag = True
    for j in cd:
        if (j == 1):
            continue
        if (i % j == 0):
            flag = False
            break
    if (flag):
        cd.append(i)
print(len(cd))

### FIXED CODE ###

# ABC141d
import sys
import heapq
import math
import fractions
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

a, b = map(int, input().split())
cd = []


def prime_decomposition(n):
    i = 2
    table = set()
    while i * i <= n:
        while n % i == 0:
            n /= i
            table.add(i)
        i += 1
    if n > 1:
        table.add(n)
    return table


print(len(prime_decomposition(a).intersection(prime_decomposition(b)))+1)
exit()

for i in range(1, fractions.gcd(a, b) + 1):
    if (a % i != 0 or b % i != 0):
        continue
    flag = True
    for j in cd:
        if (j == 1):
            continue
        if (i % j == 0):
            flag = False
            break
    if (flag):
        cd.append(i)
print(len(cd))
big_ple=X/500*1000
remain=X%500
small_ple=remain/5*5
Sum=big_ple+small_ple

if X<5:
    print(0)
elif X<500:
    print(small_ple)
else:
     print(Sum)

### FIXED CODE ###

X=int(input())
big_ple=X//500*1000
remain=X%500
small_ple=remain//5*5
Sum=big_ple+small_ple
 
if X<5:
    print(0)
elif X<500:
    print(small_ple)
else:
     print(Sum)
a = (input().split())
b = (input().split())

c = a * b

ans = 'Even' if c % 2 == 0 else 'Odd'
print(ans)


### FIXED CODE ###

i = list(map(int, input().split()))

c = i[0] * i[1]

ans = 'Even' if c % 2 == 0 else 'Odd'
print(ans)
S = input()

count=0

for i in range(len(S) // 2):
    if S[i] != RS[-i-1]:
        count += 1

print(count)

### FIXED CODE ###

S = input()


count=0

for i in range(len(S) // 2):
    if S[i] != S[-1-i]:
        count += 1

print(count)
from sys import stdin

[H, N] = [int(x) for x in stdin.readline().rstrip().split()]
As = []
Bs = []

for i in range(N):
    [a, b] = [int(x) for x in stdin.readline().rstrip().split()]
    As.append(a)
    Bs.append(b)


map_list = []
for i in range(10001):
    map_list.append(-1)


def DP(h):
    if h<=0:
        return 0
    if map_list[h]>=0:
        return map_list[h]
    
    temp_array = []
    for i in range(N):
        temp_array.append(DP(h-As[i])+Bs[i])
    map_list[h] = min(temp_array)
    

    return map_list[h]

print(DP(H))    



### FIXED CODE ###

from sys import stdin
from sys import  setrecursionlimit
setrecursionlimit(10000)

[H, N] = [int(x) for x in stdin.readline().rstrip().split()]
As = []
Bs=[]
for i in range(N):
    [A, B] = [int(x) for x in stdin.readline().rstrip().split()]
    As.append(A)
    Bs.append(B)

INF = 10**10
dp_map = [[INF]*(H+1) for _ in range(N+1)]

#dp_map[i][j]: i番目の魔法までを使って、最低でもjのダメージを与える時に必要なMP
dp_map[0][0]  = 0
for i in range(N):
    for j in range(H+1):
        if j<As[i]:
            dp_map[i+1][j] = min(dp_map[i+1][0]+Bs[i],dp_map[i][j])
        else:
            dp_map[i+1][j] = min(dp_map[i+1][j-As[i]]+Bs[i] ,dp_map[i][j])

print(dp_map[N][H])
n=input()
l1=list(n)
l1=l1[::-1]
num=len(n)
ans=[0 for i in range(13)]
if l1[0]=="?":
  for i in range(0,10):
    ans[i]=1
else:
  ans[int(l1[0])]=1
for i in range(1,num):
  mod=(10**i)%13
  dp=[ans[i] for i in range(13)]
  if l1[i]=="?":
    lmod=[(j*mod)%13 for j in range(10)]
    for j in range(13):
      ans1=0
      for k in lmod:
        if j-k>=0:
          mod2=j-k
        else:
          mod2=13+j-k
        ans1=(ans1+dp[mod2])%(10**9+7)
      ans[j]=ans1%(10**9+7)
  else:
    num1=int(l1[i])
    mod1=(num1*mod)%13
    for j in range(13):
      if j-mod1>=0:
        mod2=j-mod1
      else:
        mod2=13+j-mod1
      ans[j]=dp[mod2]
print(l[num-1][5]%(10**9+7))


### FIXED CODE ###

n=input()
l1=list(n)
l1=l1[::-1]
num=len(n)
ans=[0 for i in range(13)]
modlist=[1,10,9,12,3,4]
if l1[0]=="?":
  for i in range(0,10):
    ans[i]=1
else:
  ans[int(l1[0])]=1
for i in range(1,num):
  mod=modlist[i%6]
  dp=[ans[i] for i in range(13)]
  if l1[i]=="?":
    lmod=[(j*mod)%13 for j in range(10)]
    for j in range(13):
      ans1=0
      for k in lmod:
        if j-k>=0:
          mod2=j-k
        else:
          mod2=13+j-k
        ans1=(ans1+dp[mod2])%(10**9+7)
      ans[j]=ans1%(10**9+7)
  else:
    num1=int(l1[i])
    mod1=(num1*mod)%13
    for j in range(13):
      if j-mod1>=0:
        mod2=j-mod1
      else:
        mod2=13+j-mod1
      ans[j]=dp[mod2]
print(ans[5]%(10**9+7))
N = int(input())
W = map(int,input().split())
list = []
for n in range(N):
  a = 1
  b = n + 1
  Down = 0
  Up = 0
  while a <= n:
    Down += W[a - 1]
    a += 1
  while b <= N:
    Up += W[b - 1]
    b += 1
  list.append(abs(Down - Up))
list.sort()
print(list[0])

### FIXED CODE ###

N = int(input())
W = list(map(int,input().split()))
list = []
for n in range(N):
  a = 1
  b = n + 1
  Down = 0
  Up = 0
  while a <= n:
    Down += W[a - 1]
    a += 1
  while b <= N:
    Up += W[b - 1]
    b += 1
  list.append(abs(Down - Up))
list.sort()
print(list[0])
n = input()
f = [for i in range(n)]
f = 0
f[1] = 1
for i in range(n):
  A = map(int, raw_input().split())
  j = 2000
  while 0 < j:  
    if(j + A < 2000 && f[j + 1] == 1):
      f[j + A + 1] == 1
    j- = 1
 
Q = input()
for i in range(Q)
  m = map(int, raw_input().split())
  if(f[m] == 1):
    print "yes"
  else:
    print "no"

### FIXED CODE ###

n = int(raw_input())
A = map(int,raw_input().split())
Q = int(raw_input())
m = map(int,raw_input().split())

def s(i, m):
  if m == 0:
    return True
  if i >= n or m > sum(A):
    return False
  r = s(i + 1, m) or s(i + 1, m - A[i])
  return r

for j in range(Q):
  if s(0, m[j]):
    print "yes"
  else:
    print "no"
while True:
  h,w=map(int,input().split())
  if h==0 & w==0:
    break
  for i in range(h):
    for i in range(w):
      if (i+j)%2==0:
        print("#", end ="")
      else:
        print(".", end="")
    print("")
  print("")


### FIXED CODE ###

while True:
  h,w=map(int,input().split())
  if h==0 & w==0:
    break
  for i in range(h):
    print(("#."* w)[i%2:][:w])
  print()
# n,aを入力
n, a = map(int, input().split())
# nを500で割り余りを計算
if n % 500 == 0: # nが500の倍数
	print('Yes')
elif (n % 500) == a: # nを500で割った余りがaと等しい
 	print('yes')
else:
  	print('No')


### FIXED CODE ###

N = int(input())
A = int(input())
if (N % 500) > A:
  print('No')
else:
  print('Yes')
h, w = map(int, input().split())
cells = []
cells.append(['.']*(w+2))
for i in range(h):
    l = ['.']
    s = input().split()
    l+=list(s[0])
    l+=['.']
    cells.append(l)
cells.append(['.']*(w+2))

for i in range(1,len(cells)-1):
    for j in range(1,len(cells)-1):
        if cells[i][j] == '#':
            if cells[i-1][j] == '#':
                pass
            elif cells[i+1][j] == '#':
                pass
            elif cells[i][j-1] == '#':
                pass
            elif cells[i][j+1] == '#':
                pass
            else:
                print("No")
                exit()
print("Yes")

### FIXED CODE ###

h, w = map(int, input().split())
cells = []
for i in range(h):
    s = input().split()
    cells.append(s[0])
ans = True
for i in range(1,h-1):
    for j in range(1,w-1):
        if cells[i][j] == '#':
            if cells[i-1][j] != '#' and cells[i+1][j] != '#' and cells[i][j-1] != '#' and cells[i][j+1] != '#':
                ans = False
                break
 
if ans: print("Yes")
else: print("No")
A = list(map(int,input().split()))
for i in range(3):
    if sum(x==A[i] for x in A) == 1:
        continue
    elif sum(x==A[i] for x in A) ==2:
        print("Yes")
        return
print("No")


### FIXED CODE ###

def solve():
    A = list(map(int,input().split()))
    for i in range(3):
        if sum(x==A[i] for x in A) == 1 or sum(x==A[i] for x in A) == 3:
            continue
        elif sum(x==A[i] for x in A) ==2:
            print("Yes")
            return
    print("No")

solve()
n = int(input())
a = list(map(int,input().split()))
l =[]
for i in a:
    l.append(i//400)
x = set()
y = 0
for i in l:
    if i< 7:
        x.add(i)
    else:
        y +=1
x = len(x)
if x:
    mi =x
else:
    mi =1
ma =x+y
print('{} {}'.format(mi.ma))

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
l =[]
for i in a:
    l.append(i//400)
x = set()
y = 0
for i in l:
    if i<= 7:
        x.add(i)
    else:
        y +=1
x = len(x)
if x:
    mi =x
else:
    mi =1
ma = x+y
print('{} {}'.format(mi, ma))
import math

def lcm(a, b):
    y = a*b / math.gcd(a, b)
    return int(y)

A, B, C, D = map(int, input().split())

A -= 1

lcm_cd = lcm(C, D)
a_by_c = A // C
a_by_d = A // D
b_by_c = B // C
b_by_d = B // D
a_by_cd = A // lcm_cd
b_by_cd = B // lcm_cd

toB = B - (b_by_c + b_by_d - b_by_cd)
toA = A - (a_by_c + a_by_d - a_by_cd)

print(toB - toA)

### FIXED CODE ###

import fractions

def lcm(a, b):
    y = a*b / fractions.gcd(a, b)
    return int(y)

A, B, C, D = map(int, input().split())

A -= 1

lcm_cd = lcm(C, D)
a_by_c = A // C
a_by_d = A // D
b_by_c = B // C
b_by_d = B // D
a_by_cd = A // lcm_cd
b_by_cd = B // lcm_cd

toB = B - (b_by_c + b_by_d - b_by_cd)
toA = A - (a_by_c + a_by_d - a_by_cd)

print(toB - toA)
N, K = map(int, input().split())
a = list(map(int, input().split()))
chk = [0] * N
start = -1
ido = [0]
chk[0] = 1
index = 0
cnt = 0
while True:
    index = a[index] - 1
    if chk[index] == 0:
        chk[index] += 1
        cnt += 1
        ido.append(index)
    else:
        start = index
        break

if cnt > K:
    print(a[ido[K]])
    exit()
tmp = ido.index(start)
ido = ido[index:]
K -= tmp
print(ido[K % len(ido)] + 1)

### FIXED CODE ###

N, K = map(int, input().split())
a = list(map(int, input().split()))
chk = [0] * N
start = -1
ido = [0]
chk[0] = 1
index = 0
cnt = 0
while True:
    index = a[index] - 1
    if chk[index] == 0:
        chk[index] += 1
        cnt += 1
        ido.append(index)
    else:
        start = index
        break

if cnt >= K:
    print(ido[K] + 1)
    exit()
tmp = ido.index(start)
ido = ido[tmp:]
K -= tmp
print(ido[K % len(ido)] + 1)
s = input()
if (s[:4] == 2019 and s[5] == 0 and s[6] <= 4) or (s[:4] < 2019):
  print("Heisei")
else:
  print("TBD")

### FIXED CODE ###

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