Harryxun/stf_run huggingface dataset:
n,k=map(int,input().split())
edge=[]
mod=10**9+7
for i in range(n-1):
    a,b=map(int,input().split())
    edge.append([a-1,b-1])
root=[[] for i in range(n)]
for [a,b] in edge:
    root[a].append(b)
    root[b].append(a)
def perm(k,n):
    x=1
    for i in range(k,k-n,-1):
        x=x*i%mod
    return x
def dfs(node,depth,prev): 
    l=len(root[node])
    d=depth
    x=1
    if l==0:
        return 1
    if l==1 and root[node][0]==prev:
        return 1
    if depth>1:
        x=perm(k-d,l-1)
    else:
        x=perm(k-d,l)
    for y in root[node]:
        if y!=prev:
            x=x*dfs(y,min(depth+1,2),node)%mod
    return x
count=dfs(0,1,0)*k%mod
print(count if count>0 else 0)

### FIXED CODE ###

n,k=map(int,input().split())
mod=10**9+7
import sys
sys.setrecursionlimit(10**9)
root=[[] for i in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    root[a-1].append(b-1)
    root[b-1].append(a-1)
def perm(k,n):
    x=1
    if k-n+1<=0:
        return 0
    for i in range(k,k-n,-1):
        x=x*i%mod
    return x
def dfs(node,depth,prev): 
    l=len(root[node])
    d=depth
    x=1
    if l==0:
        return 1
    if l==1 and depth>1:
        return 1
    if depth>1:
        x=perm(k-d,l-1)
    else:
        x=perm(k-d,l)
    for y in root[node]:
        if y!=prev:
            x=x*dfs(y,2,node)%mod
    return x%mod
count=dfs(0,1,0)*k%mod
print(count if count>0 else 0)
S = input().split()
X = int(S[0])+int(S[1])
Y = int(S[0])-int(S[1])
Z = int(S[0])*int(S[1])
intS[0] = ss
intS[1] = dd
if X >= Y:
    if X >= Z:
        print(X)
    else:
        print(Z)
else:
    if Y >= Z:
        print(Y)
    else:
        print(Z)


### FIXED CODE ###


S = input().split()
X = int(S[0])+int(S[1])
Y = int(S[0])-int(S[1])
Z = int(S[0])*int(S[1])
if X >= Y:
    if X >= Z:
        print(X)
    else:
        print(Z)
else:
    if Y >= Z:
        print(Y)
    else:
        print(Z)
N = int(input())
dp = [0] * 701
dp[0] = 1
target = [3, 4, 5, 6, 7, 8, 9]
for i in range(0, 600):
    for t in target:
        dp[i+t] += dp[i]
print(dp[N])


### FIXED CODE ###

N = int(input())
MOD = 10 ** 9 + 7
dp = [0] * 2010
dp[0] = 1
for i in range(3, N + 1):
    for j in range(i - 3 + 1):
        dp[i] = (dp[i] + dp[j]) % MOD
print(dp[N])
import sympy
n = int(input())

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

a.sort(reverse = True)

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

if len(set(a)) == 1:
    print(0)
else:
    
    
    ans = 0

    for i in range(n):
        target = sympy.divisors(a[i])
        if len(set(target) & set(a)) == 1:
            ans += 1

    print(ans)
        

### FIXED CODE ###

n = int(input())

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

M = 1000005

cnt = [0 for i in range(M)]

for x in a:
    if cnt[x] != 0:
        cnt[x] = 2
        continue
    for i in range(x, M, x):
        cnt[i] += 1

ans = 0

for x in a:
    if cnt[x] == 1:
        ans += 1
    
print(ans)
x,y = map(int,input().split())
min = 2019
n = y-x
i=0
while(i<n):
  s = (x + i) % 2019
  i = i +1
  if s == 0:
    print(s)
    break
  elif min > s:
    min = s:
min2 = 2019
j=0
while(j<n):
  g = (x + j) % 2019
  j=j+1
  if g == 0:
    break
  elif min2 > g and g != min:
    min2 =g

if s != 0:
  z = (min*min2)%2019
  print(z)


### FIXED CODE ###

l, r = map(int, input().split())

min = 2019

for i in range(l, r+1):
    for j in range(i+1, r+1):
        p = (i % 2019)*(j % 2019) % 2019
        if p < min:
            min = p

        if min == 0:
            print("0")
            exit()

print(min)
import numpy as np


H, N = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
a, b = np.array(AB, dtype=np.int64).reshape(N, 2).T

d = np.zeros(H + 1, dtype=np.int64)

for hp in range(1, H + 1):
    c = d[np.maximum(hp - a, 0)] + b
    d[hp] = np.amin(c)
    print(hp, np.amin(c))

print(d[H])

### FIXED CODE ###

H = int(input())

# monster HP is X
# X==1 >> X=0
# X>1  other 2 monster appear. These 2 mosters have [X/2] HP.
# No.i monster vitalitiy is Hi
# two actions
# attack : reduce 1 vitaility
# special: make vitality 0. Fenek can use K times of specials.
# print(type(2*10**14))

# from collections import deque
#
# print(f"H={H}")
#
# monsters = deque()
# monsters.append(H)
# attack = 0
#
# while monsters:
# # for _ in range(3):
#     hp = monsters.popleft()
#     # print(f"attack to monster(HP={hp})")
#     if hp != 1:
#         # print(f"new 2 monsters(HP={hp//2}) appears!")
#         hp_hp = hp//2
#         monsters.extend([hp_hp, hp_hp])
#         # print(monsters)
#     attack += 1

i = 1
while H > 1:
    H //= 2
    i += 1
# print(attack)
print(2**i - 1)
Q = int(input())
for i in range(Q):
	A,B = map(int,input().split())
	if A == 1 and B == 1:
		print(0)
		continue
	score = A * B
	root = int((score-1) ** 0.5)
	ans = 2 * root
	if root >= A:
		ans -= 1
	if root >= B:
		ans -= 1
	if (score - 1) // root == root:
		ans -= 1
	print(ans)

### FIXED CODE ###

l = sorted(list(map(int,input().split())))
C,B,A = l[0],l[1],l[2]
cnt = 0
while A != B or B != C or C != A:
	if A == B:
		if C < A:
			C += 2
			cnt += 1
		elif C > A:
			A += 1
			B += 1
			cnt += 1
	else:
		B += 1
		C += 1
		cnt += 1
print(cnt)
H, W = map(int, input().split())
S = [list(map(int, input().split())) for i in range(H)]

for i in range(H):
  for j in range(W):
    if s[i][j] == '.':
      cnt = 0
      if S[i-1][j-1] == '#':
        cnt += 1
      if S[i-1][j] == '#':
        cnt += 1
      if S[i-1][j+1] == '#':
        cnt += 1
      if S[i][j-1] == '#':
        cnt += 1
      if S[i][j+1] == '#':
        cnt += 1
      if S[i+1][j-1] == '#':
        cnt += 1
      if S[i+1][j] == '#':
        cnt += 1
      if S[i+1][j+1] == '#':
        cnt += 1
      S[i][j] = cnt
    
    
print(S)
    


### FIXED CODE ###

H, W = map(int, input().split())
S = []
for i in range(H):
    S.append(list(input()))
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

for i in range(H):
  for j in range(W):
    if S[i][j] == '#':
      continue
    cnt = 0
    for n in range(8):
      ni = i + dx[n]
      nj = j + dy[n]
      if ni < 0 or H <= ni or nj < 0 or W <= nj:
        continue
      if S[ni][nj] == '#':
        cnt += 1
    S[i][j] = str(cnt)


    
for i in range(H):
    print("".join(S[i]))
A. B, C = input().split()
print("A{}C".format(B[0]))

### FIXED CODE ###

A, B, C = input().split()
print("A{}C".format(B[0]))
A,B,C = (int(i) for in input().split())
sho=B//A

if sho >= C :
    print(C)
else:
    print(sho)

### FIXED CODE ###

A,B,C = (int(i) for i in input().split())
sho=B//A

if sho >= C :
    print(C)
else:
    print(sho)
N,M,X = map(int,input().split())
C = []
for i in range(N):
    C.append(list(map(int,input().split())))

cost = 100000000000000000000000
l = list(range(1,N+1))
import itertools
for i in range(1,N+1):
    check_l = list(itertools.combinations(l,i))
    for a in check_l:
        sub_list = [0] * (M + 1)
        for j in range(i):
            for k in range(M+1):
                sub_list[k] += C[a[i]-1][k]
        flag = True
        for p in range(M):
            if sub_list[p+1] < X:
                flag = False
        if flag == True:
            if cost > sub_list[0]:
                cost = sub_list[0]

if cost == 100000000000000000000000:
    print(-1)
else:
    print(cost)

### FIXED CODE ###

N,M,X = map(int,input().split())
C = []
for i in range(N):
    C.append(list(map(int,input().split())))

cost = 100000000000000000000000
l = list(range(1,N+1))
import itertools
for i in range(1,N+1):
    check_l = list(itertools.combinations(l,i))
    for a in check_l:
        sub_list = [0] * (M + 1)
        for j in range(i):
            for k in range(M+1):
                sub_list[k] += C[a[j]-1][k]
        flag = True
        for p in range(M):
            if sub_list[p+1] < X:
                flag = False
        if flag == True:
            if cost > sub_list[0]:
                cost = sub_list[0]

if cost == 100000000000000000000000:
    print(-1)
else:
    print(cost)
aa, b = map(int, input().split())
if a == 2 or b == 2:
    print(1)
else:
    print(a*b - (a + b - 1))


### FIXED CODE ###

a, b = map(int, input().split())
if a == 2 or b == 2:
    print(1)
else:
    print(a*b - (a + b - 1))
n=int(input())
a=[input() for i in range(n)]
a=list(map(lambda x:list(x),a))
count=0
for i in range(len(a)):
    for j in range(i+1,len(a)):
        if intersect_list(a[i],a[j])==len(col):
            count+=1
print(count)

### FIXED CODE ###

x,y = map(int,input().split())
a=x+y
b=x-y
c=x*y
print(max([a,b,c]))
S = input()
A =set()
t = 0
for i in range(len(S)):
  if S[i] == 'A' or S[i] == 'G' or S[i] == 'C' or S[i] == 'T':
    t += 1
  else:
    A.add(t)
    t = 0
print(max(A))

### FIXED CODE ###

S = input()
A =set()
t = 0
for i in range(len(S)):
  if S[i] == 'A' or S[i] == 'G' or S[i] == 'C' or S[i] == 'T':
    t += 1
  else:
    A.add(t)
    t = 0
A.add(t)
print(max(A))
import math

N, K = map(int, input().split())

p1 = max(N - K + 1, 0) / N
p2 = 0.
l2K = math.log2(K)
for k in range(1, min(K, N+1)):
    p2 += (1 / N) * (0.5) ** int(l2K - math.log2(k) + 1)

print(p1 + p2)

### FIXED CODE ###

import numpy as np

N, K = map(int, input().split())

p1 = max(N - K + 1, 0) / N
p2 = 0.
l2K = np.log2(K)
for k in range(1, min(K, N+1)):
    p2 += (0.5) ** np.ceil(l2K - np.log2(k))

print(p1 + p2 / N)
s=input()
n=len(s)
s1=s[0:(n-1)/2]
s2=s[(n+1)/2:n]
if s==s[::-1] and s1==s1[::-1] and s2==s2[::-1]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

s=input()
n=len(s)
s1=s[0:(n-1)//2]
s2=s[(n+1)//2:n]
if s==s[::-1] and s1==s1[::-1] and s2==s2[::-1]:
  print("Yes")
else:
  print("No")
import.math
x= int(input())
y = 2*math.pi*x
print(y)

### FIXED CODE ###

import math
r = int(input())
s = 2 * r * math.pi
print(s)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################

N, M = map(int, input().split())
graph = [ [0 for _ in range(M)] for _ in range(M) ]
visited = [False] * M

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

#print(graph)

# u は 0-index
count = 0
def dfs(u, count):
    visited[u] = True
    if False in visited:
        pass
    else:
        count += 1

    for i in range(M):
        if graph[u][i] == False: continue
        if visited[i]: continue

        visited[i] = True
        count = dfs(i, count)
        visited[i] = False

    return count

count = dfs(0, count)
print(count)


### FIXED CODE ###


import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################

# N = 頂点の数(= 数字の数)
# M = 辺の数(= aの行数)

N, M = map(int, input().split())
graph = [ [0 for _ in range(N)] for _ in range(N) ]
visited = [False] * N

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

#print(graph)

# u は 0-index
def dfs(u):
    visited[u] = True
    if False in visited:
        pass
    else:
        return 1

    count = 0
    for i in range(N):
        if graph[u][i] == False: continue
        if visited[i]: continue

        visited[i] = True
        count += dfs(i)
        visited[i] = False

    return count

count = dfs(0)
print(count)
n = input()
a = [input() for _ in range(n)]
m = input()
for _ in range(m):
  b,c = [int(x) for x in input.split()]
  a[b-1] = c
  print(sum(a))

### FIXED CODE ###

from copy import deepcopy
n = int(input())
a = [int(x) for x in input().split()]
m = int(input())
for _ in range(m):
  t = deepcopy(a)
  b,c = [int(x) for x in input().split()]
  t[b-1] = c
  print(sum(t))
H, W = map(int, input().split())
S = [input() for i in range(W)]
dd = ((0,-1),(-1,0),(0,1),(1,0))
for i in range(H):
  for j in range(W):
    if S[i][j] == '.':
      continue
    for dx,dy in dd:
      nx = j + dx
      ny = i + dy
      if 0 <= nx < W and 0 <= ny < H and S[ny][nx] == '#':
        break
    else:
      print('No')
      quit()
print('Yes')

### FIXED CODE ###

H, W = map(int, input().split())
S = [input() for i in range(H)]
dd = ((0, -1), (-1, 0), (0, 1), (1, 0))
for i in range(H):
  for j in range(W):
    if S[i][j] == '.':
      continue
    for dx, dy in dd:
      nx = j + dx
      ny = i + dy
      if 0 <= nx < W and 0 <= ny < H and S[ny][nx] == '#':
        break
    else:
      print('No')
      quit()
print('Yes')
h, w, a, b = map(int, input().split())
for i in range(b):
    for j in range(a):
        print(0, end=4)
    for j in range(w - a):
        print(1, end=4)
    print()
for i in range(h - b):
    for j in range(a):
        print(1, end=4)
    for j in range(w - a):
        print(0, end=4)
    print()


### FIXED CODE ###

h, w, a, b = map(int, input().split())
for i in range(b):
    for j in range(a):
        print(0, end='')
    for j in range(w - a):
        print(1, end='')
    print()
for i in range(h - b):
    for j in range(a):
        print(1, end='')
    for j in range(w - a):
        print(0, end='')
    print()
#input
s = input()
t = input()

#output
import numpy as np
m = len(s)
n = len(t)
dp = np.zeros((m+1, n+1), int)

for i in range(m):
    for j in range(n):
        if s[i] == t[j]:
            dp[i+1, j+1] = dp[i, j]+1
        else:
            dp[i+1, j+1] = max(dp[i, j+1], dp[i+1, j])

ans = ""
while m > 0 and n > 0:
    if dp[m, n] == dp[m-1, n]:
        m -= 1
    elif dp[m, n] == dp[m, n-1]:
        n -= 1
    elif dp[m, n] == dp[m-1, n-1] + 1:
        ans += t[n-1]
        m -= 1
        n -= 1

print(ans[::-1])

### FIXED CODE ###

#input
s = input()
t = input()

#output
m = len(s)
n = len(t)
dp = [[0]*(m+1) for _ in range(n+1)]

for i in range(n):
    for j in range(m):
        if t[i] == s[j]:
            dp[i+1][j+1] = dp[i][j]+1
        else:
            dp[i+1][j+1] = max(dp[i][j+1], dp[i+1][j])

ans = ""
while m > 0 and n > 0:
    if dp[n][m] == dp[n-1][m]:
        n -= 1
    elif dp[n][m] == dp[n][m-1]:
        m -= 1
    elif dp[n][m] == dp[n-1][m-1] + 1:
        ans += t[n-1]
        n -= 1
        m -= 1

print(ans[::-1])
import numpy as np

N,K = list(map(int, input().split(" ")))
A = list(map(int, input().split(" "))) # consumption coefficient of members
F = list(map(int, input().split(" "))) # difficulty of food

# pair fastest eaters (low consumption coefficient) with most difficult foods
A.sort()
F.sort(reverse=True)
A = np.array(A)
F = np.array(F)

maxT = np.max(A*F)
# use binary search to find lowest possible T
left = -1
right = maxT
while left+1< right:
    mid = (left+right)//2
    if np.maximum(0, A - (mid//F)).sum() <= K:
        right  = mid
    else:
        left = mid
print(right)



### FIXED CODE ###

A, B = list(map(int, input().split(" ")))
if not A >9 and not B >9:
    print(A*B)
else:
    print("-1")
#ALDS1_3-C Elementary data structures - Doubly Linked List
n=int(input())
cmds={"insert":lambda cmd: L.insert(0,cmd[1]),
      "delete":lambda cmd: L.remove(cmd[1]),
      "deleteFirst":lambda cmd: L.pop(0),
      "deleteLast": lambda cmd: L.pop()
     }
L=[]
for i in range(n):
    cmd=input().split()
    cmds[cmd[0]](cmd)
s=""
for i in L:
    s+=i+" "
print(s[:-1])

### FIXED CODE ###

#ALDS1_3-C Elementary data structures - Doubly Linked List
import collections
import sys
q = collections.deque()
n=int(input())
_input = sys.stdin.readlines()
cmds={"insert":lambda cmd: q.appendleft(cmd[1]),
      "delete":lambda cmd: q.remove(cmd[1]) if (q.count(cmd[1]) > 0) else "none",
      "deleteFirst":lambda cmd: q.popleft(),
      "deleteLast": lambda cmd: q.pop()
     }

for i in range(n):
    cmd=_input[i].split()
    cmds[cmd[0]](cmd)
print(*q)
import bisect
n=int(input())
s=input()
q=int(input())
ch={i:[-1,n+1] for i in 'abcdefghijklmnopqrstuvwxyz'}

for i in range(n):
    bisect.insort(ch[s[i]],i)
    
for i in range(q):
    m,l,r=input().split()
    if m=='1':
        l=int(l)-1
        ch[s[l]].remove(l)
        bisect.insort(ch[r],l)
    else:
        l,r=int(l)-1,int(r)-1
        res=0
        for i in 'abcdefghijklmnopqrstuvwxyz':
            if len(ch[i])>0:
                res+=(ch[i][bisect.bisect_left(ch[i],l)]<=r)
        print(res)

### FIXED CODE ###

import bisect
n = int(input())
s = list(input())
alp = 'abcdefghijklmnopqrstuvwxyz'
cnt = {c: [] for c in alp}

for i, c in enumerate(s):
    cnt[c].append(i)

q = int(input())
for _ in range(q):
    t, x, y = input().split()
    ans = 0
    if t == '1':
        i, c = int(x) - 1, y
        if s[i] == c:
            continue
        a = bisect.bisect_left(cnt[s[i]], i)
        cnt[s[i]].pop(a)
        s[i] = c
        b = bisect.bisect_left(cnt[c], i)
        cnt[c].insert(b, i)
    else:
        l, r = int(x) - 1, int(y) - 1
        for c in alp:
            a = bisect.bisect_left(cnt[c], l)
            if a < len(cnt[c]) and cnt[c][a] <= r:
                ans += 1

        print(ans)
import sys
 import copy
 sys.setrecursionlimit(1000000)
 K, S = map(int, input().split())
 ans = 0
 for x in range(K + 1):
     for y in range(K + 1):
         z = S - (x + y)
         if z >= 0 and z <= K:
             ans += 1
 print(ans)

### FIXED CODE ###

k, s = map(int, input().split())
count = 0
for x in range(k + 1):
    for y in range(k + 1):
        z = s - x - y
        if 0 <= z <= k:
            count += 1
print(count)
N, M, K = map(int, input().split())
A_list = list(map(int, input().split()))
B_list = list(map(int, input().split()))

A_sum = [0]
B_sum = [0]

for a in A_list:
    A_sum.append(A_sum[-1] + a)

for b in B_list:
    B_sum.append(B_sum[-1] + b)

count = 0


def solve(i, j):
    global count
    if A_sum[i] + B_sum[j] > K:
        return
    if count < i + j:
        count = i + j
    if i == len(A_sum) - 1 and j == len(B_sum) - 1:
        return
    elif i == len(A_sum) - 1:
        solve(i, j + 1)
    elif j == len(B_sum) - 1:
        solve(i + 1, j)
    else:
        solve(i + 1, j)
        solve(i, j + 1)


solve(0, 0)
print(count)

### FIXED CODE ###

N, M, K = map(int, input().split())
A_list = list(map(int, input().split()))
B_list = list(map(int, input().split()))

A_sum = [0]
B_sum = [0]

for a in A_list:
    A_sum.append(A_sum[-1] + a)

for b in B_list:
    B_sum.append(B_sum[-1] + b)

count = 0
j = M
for i, a in enumerate(A_sum):
    if a > K:
        break
    while B_sum[j] > K - a:
        j -= 1
    if count < i + j:
        count = i + j

print(count)
def fib(W):
    a, b = 1, 1
    n = [a, b]
    while W > len(n):
        a, b = b, b + a
        n.append(b)
    return n
H, W, K = map(int, input().split())
f = fib(W)
r = [1] + [0] * (W - 1)
for i in range(H):
    tmp = [0] * W
    for j in range(W):
        if j == 0:
            tmp[j] = r[j] * f[W - j - 1] + r[j + 1] * f[W - j - 2]
        elif j == W - 1:
            tmp[j] = r[j] * f[j] + r[j - 1] * f[j - 1]
        else:
            tmp[j] = r[j] * f[j] * f[W - j - 1] + r[j + 1] * f[W - j - 2] * f[j] + r[j - 1] * f[W - j - 1] * f[j - 1]
    r = tmp
print(r[K - 1] % 1_000_000_007)

### FIXED CODE ###

def fib(W):
    a, b = 1, 1
    n = [a, b]
    while W > len(n):
        a, b = b, b + a
        n.append(b)
    return n
H, W, K = map(int, input().split())
f = fib(W)
r = [1] + [0] * (W - 1)
for i in range(H):
    tmp = [0] * W
    for j in range(W):
        if j == 0:
            tmp[j] = r[j] * f[W - j - 1] + r[j + 1] * f[W - j - 2] if W != 1 else 1
        elif j == W - 1:
            tmp[j] = r[j] * f[j] + r[j - 1] * f[j - 1]
        else:
            tmp[j] = r[j] * f[j] * f[W - j - 1] + r[j + 1] * f[W - j - 2] * f[j] + r[j - 1] * f[W - j - 1] * f[j - 1]
    r = tmp
print(r[K - 1] % 1000000007)
x,y=map(int,input().split())
f=[[0]*(10**3) for i in range(10**3)]
for i in range(x):
  for j in range(y):
    f[i][j]=f[i-1][j-2]+f[i-2][j-1]
print(f[x][y])

### FIXED CODE ###

x,y=map(int,input().split())
mod = 10**9+7
flflag=True

if (2*x-y)%3==0:
  a=(2*x-y)//3
else:
  flflag=False
if (2*y-x)%3==0:
  b=(2*y-x)//3
else:
  flflag=False

def kaijou(n):
  ans = 1
  for i in range(1,n+1):
    ans*=i%mod
    ans%=mod  
  return ans
if flflag:
  N=a+b
  R=min(a,b)
ans=0
if flflag==True and a>=0 and b>=0:
  ans=kaijou(N)
  ans1= (kaijou(N-R)*kaijou(R))%mod
  print((ans*pow(ans1,mod-2,mod))%mod)
else:
  print(0)
input = input()
result = 0
for i in range(len(input) - 2):
    serach = input[i:i+3]
    if serach == "ABC":
        result += 1
console.log(result)

### FIXED CODE ###

num = input()
input = input()
result = 0
for i in range(len(input) - 2):
    serach = input[i:i+3]
    if serach == "ABC":
        result += 1
print(result)
n = int(input())
s = {}
for i in range(n):
    d = input()
    if d in s:
        s[d] += 1
    else:
        s.update({d:1}) 

m = int(input())
for j in range(m):
    t = input()
    if t in s:
        s[t] -= 1
    else:
        s.update({t:-1})

print("0" if max(d.values()) < 0 else max(d.values()))


### FIXED CODE ###

n = int(input())
s = list(input() for _ in range(n))

m = int(input())
t = list(input() for _ in range(m))

a = 0
d = 0
for i in s:
    a = s.count(i)-t.count(i)
    if d <= a:
        d = a
print(d)
s = input()
a =['SUN','MON','TUS','WED','THU','FRI','SAT']
if s!= 'SUN':
	print(a.index(s))
else:
  print(7)

### FIXED CODE ###

s = input()
a =['SUN','MON','TUE','WED','THU','FRI','SAT']

print(7-a.index(s))
n, k = map(int, input().split())
ps = list(map(int, input().split()))

p = [ (p+1)/2 for p in ps]

pn_max = 0
for i in range(0, n-2):
  pn = 0
  for j in range(k):
  	pn += ps[i+j]
  pn_max = max(pn_max, pn)

print((pn_max+k)/2)

### FIXED CODE ###

n, k = map(int, input().split())
p = list(map(int, input().split()))

ans = sum(p[:k])

psum = [0] * n
psum[0] = p[0]
for i in range(1, n):
  psum[i] = psum[i-1] + p[i]

anss = [0] * n
for i in range(n-k):
  anss[i] = psum[i+k] - psum[i]

print((max(ans, max(anss))+k)/2)
c = input()
if c == a:
    print('vowel')
elif c == e:
    print('vowel')
elif c == i:
    print('vowel')
elif c == o:
    print('vowel')
elif c == u:
    print('vowel')
else:
    print('consonant')
    

### FIXED CODE ###

c = input()
d =['a', 'e', 'i', 'o', 'u']

if c in d:
    print('vowel')
else:
    print('consonant')