Harryxun/stf_run huggingface dataset:
a = int(input())
b = input().split()
teki = [int(i) for i in b]
c = input().split()
yuusya = [int(i) for i in c]

count = 0

if yuusya[0] >= teki[0]:
    yuusya[0] -= teki[0]
    count += teki[0]
    teki[0] = 0
else:
    count += yuusya[0]
    teki[0] -= yuusya[0]
for i in range(1, len(yuusya)):
    if yuusya[i - 1] > 0:
        if yuusya[i - 1] > teki[i]:
            count += teki[i]
            continue
        else:
            count += yuusya[i-1]
            teki[i]-=yuusya[i-1]
    if yuusya[i] >= teki[i]:
        yuusya[i] -= teki[i]
        count += teki[i]
        teki[i] = 0
    else:
        count += yuusya[i]
        teki[i] -= yuusya[i]
        yuusya[i] = 0
        

if yuusya[i] >= teki[i+1]:
    yuusya[i] -= teki[i+1]
    count += teki[i+1]
else:
    count += yuusya[i]
    teki[i] -= yuusya[i]
    yuusya[i] = 0

print(count)

### FIXED CODE ###

a = int(input())
b = input().split()
teki = [int(i) for i in b]
c = input().split()
yuusya = [int(i) for i in c]

count = 0

if yuusya[0] >= teki[0]:
    yuusya[0] -= teki[0]
    count += teki[0]
    teki[0] = 0
else:
    count += yuusya[0]
    teki[0] -= yuusya[0]
    yuusya[0] = 0

for i in range(1, len(yuusya)):
    if yuusya[i - 1] > 0:
        if yuusya[i - 1] > teki[i]:
            count += teki[i]
            yuusya[i - 1] = 0
            teki[i] = 0
            continue
        else:
            count += yuusya[i-1]
            teki[i]-=yuusya[i-1]
    if yuusya[i] >= teki[i]:
        yuusya[i] -= teki[i]
        count += teki[i]
        teki[i] = 0
    else:
        count += yuusya[i]
        teki[i] -= yuusya[i]
        yuusya[i] = 0

if len(teki) > len(yuusya) and len(teki) > 2:
    if yuusya[i] >= teki[i+1]:
        yuusya[i] -= teki[i+1]
        count += teki[i+1]
    else:
        count += yuusya[i]
        teki[i] -= yuusya[i]
        yuusya[i] = 0

print(count)
import sys                                                        
N, M = map(int, input().split())                                  
                                                                  
                                                                  
sc = dict()                                                       
for i in range(M):                                                
  s, c = map(int, input().split())                                
  if s in sc and sc[s] != c:                                      
    print(-1)                                                     
    break                                                         
  sc[s] = c                                                       
else:                                                             
  i1 = sc.get(3, -1)                                              
  i2 = sc.get(2, -1)                                              
  i3 = sc.get(1, -1)                                              
  for k3 in range(10):                                            
    if i3 != -1 and i3 != k3:                                     
      continue                                                    
    for k2 in range(10):                                          
      if i2 != -1 and i2 != k2:                                   
        continue                                                  
      for k1 in range(10):                                        
        if i1 != -1 and i1 != k1:                                 
          continue                                                
        if (                                                      
            (N == 3 and k3) or                                    
            (N == 2 and not k3 and k2) or                         
            (N == 1 and not k3 and not k2 and k1)                 
          ):                                                      
          print(int(k3 * 100 + k2 * 10 + k1))                     
          sys.exit(1)                                             
  print(-1)                                                       

### FIXED CODE ###

import sys
N, M = map(int, input().split())


sc = dict()
for i in range(M):
  s, c = map(int, input().split())
  if s in sc and sc[s] != c:
    print(-1)
    break
  sc[s] = c
else:
  if N == 1:
    i1 = sc.get(1, -1)
    i2 = -1
    i3 = -1
  elif N == 2:
    i1 = sc.get(2, -1)
    i2 = sc.get(1, -1)
    i3 = -1
  elif N == 3:
    i1 = sc.get(3, -1)
    i2 = sc.get(2, -1)
    i3 = sc.get(1, -1)

  for k in range(0, int(10 ** N)):
    k, k1 = divmod(k, 10)
    k, k2 = divmod(k, 10)
    k, k3 = divmod(k, 10)
    if k == 0 and N == 1 and (i1 == -1 or i1 == 0):
      print(0)
      break
    if (
      (N == 1 and k2 == 0 and k3 == 0 and k1) or
      (N == 2 and k3 == 0 and k2) or
      (N == 3 and k3)
    ):
      if (
        (i1 == -1 or k1 == i1) and
        (i2 == -1 or k2 == i2) and
        (i3 == -1 or k3 == i3)
      ):
        print(int(k3 * 100 + k2 * 10 + k1))
        break
  else:
    print(-1)
import itertools
import sys
from collections import Counter

sys.setrecursionlimit(10 ** 9)
M = 1000000007
N = int(sys.stdin.readline())
left = list(map(int, sys.stdin.read()))
assert len(left) == N
assert left[0] == 0

counter = Counter(left)


def dp(t, ns):
    cached = t.get(ns)
    if cached is not None:
        return cached
    remaining = sum(ns)
    assert remaining > 0
    last_cnt = left[remaining - 1] + 1
    n1, n2, n3 = ns
    res = 0
    if last_cnt == n1:
        res += dp(t, tuple(sorted([n1 - 1, n2, n3])))
        res %= M
    if last_cnt == n2:
        res += dp(t, tuple(sorted([n1, n2 - 1, n3])))
        res %= M
    if last_cnt == n3:
        res += dp(t, tuple(sorted([n1, n2, n3 - 1])))
        res %= M
    # print(f"{remaining}: ({n1},{n2},{n3}) => {res}")
    t[ns] = res
    return res


def solve():
    h = [0, 0, 0]
    for i in range(N):
        k = counter[i]
        if k == 3:
            h[0] = h[1] = h[2] = i + 1
        elif k == 2:
            h[0] = h[1] = i + 1
        elif k == 1:
            h[0] = i + 1
        else:
            break
    assert sum(h) == N
    t = dict()
    t[0, 0, 0] = 1
    res = dp(t, tuple(sorted(h)))
    return (res * len(set(itertools.permutations(h)))) % M


print(solve())


### FIXED CODE ###

import itertools
import sys
from collections import Counter

sys.setrecursionlimit(10 ** 9)
M = 1000000007
N = int(sys.stdin.readline())
left = list(map(int, sys.stdin.read().split()))
counter = Counter(left)


def dp(t, ns):
    cached = t.get(ns)
    if cached is not None:
        return cached
    remaining = sum(ns)
    assert remaining > 0
    last_cnt = left[remaining - 1] + 1
    n1, n2, n3 = ns
    res = 0
    if last_cnt == n1:
        res += dp(t, tuple(sorted([n1 - 1, n2, n3])))
        res %= M
    if last_cnt == n2:
        res += dp(t, tuple(sorted([n1, n2 - 1, n3])))
        res %= M
    if last_cnt == n3:
        res += dp(t, tuple(sorted([n1, n2, n3 - 1])))
        res %= M
    # print(f"{remaining}: ({n1},{n2},{n3}) => {res}")
    t[ns] = res
    return res


def solve():
    h = [0, 0, 0]
    for i in range(N):
        k = counter[i]
        if k == 3:
            h[0] = h[1] = h[2] = i + 1
        elif k == 2:
            h[0] = h[1] = i + 1
        elif k == 1:
            h[0] = i + 1
        else:
            break
    if sum(h) != N:
        return 0
    t = dict()
    t[0, 0, 0] = 1
    res = dp(t, tuple(sorted(h)))
    return (res * len(set(itertools.permutations(h)))) % M


print(solve())
a,b = map(list(map,input().split(" ")))
if a>b:
    print("Alice")
elif a<b :
    print("Bob")
else:
    print("Draw")

### FIXED CODE ###

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

if a==b:
    print("Draw")
    exit()
elif b==1:
    print("Bob")
    exit()
elif a==1:
    print("Alice")
    exit()
if a>b:
    print("Alice")
elif a<b :
    print("Bob")
else:
    print("Draw")
MON = list(map(int,input().split()))

While True:
  
  MON[2] = MON[2] - MON[1]
  if(MON[2] <= 0):
    print("Yes")
    break

  MON[0] = MON[0] - MON[3]
  if (MON[0] <= 0 ):
    print("No")
    break
  

### FIXED CODE ###

MON = list(map(int,input().split()))
 
while 1:
  
  MON[2] = MON[2] - MON[1]
  if(MON[2] <= 0):
    print("Yes")
    break
 
  MON[0] = MON[0] - MON[3]
  if (MON[0] <= 0 ):
    print("No")
    break
import math
x=int(input())
log_x=int(math.log(x,2))
cand=[0 for i in range(x)]
cand[0]=1
for i in range(2,x):
    cand[i]=int(pow(x,1.0/i))**i
print(max(cand))


### FIXED CODE ###

def abs(a):
  if a<0:
    return a*(-1)
  else:
    return a

a,b,c,d=list(map(int,input().split()))
if abs(a-b)<=d and abs(b-c)<=d:
  print('Yes')
elif abs(a-c)<=d:
  print('Yes')
else:
  print('No')
a,b,c = sort(map(int,input().split()))

print(a+b)

### FIXED CODE ###

a,b,c = sorted(map(int,input().split()))

print(a+b)
from collections import deque
n = int(input())
a = [int(i) for i in input().split()]
odd = deque()
even = deque()
for i, v in enumerate(a):
    if (i + 1) % 2: odd.appendleft(v)
    else: even.appendleft(v)
print(*(odd + even) if n % 2 else (even + odd))

### FIXED CODE ###

from collections import deque

n = int(input())
a = [int(i) for i in input().split()]
d = deque()
for i, v in enumerate(a):
    if i % 2: d.append(v)
    else: d.appendleft(v)
print(*d if n % 2 else reversed(d))
import numpy as np

N = int(input())
x = input().split()

data = [0 for i in range(N)]
for i in range(N):
	data[i] = int(x[i])

nxt = 1
ans = 0

for i in range(N):
	if nxt == data[i]:
		nxt += 1
	else:
		ans += 1
if ans == N:
	print(-1)
	exit(1)

print(ans)

### FIXED CODE ###

import numpy as np

N = int(input())
x = list(map(int, input().split()))

nxt = 1
ans = 0

for data in x:
	if nxt == data:
		nxt += 1
	else:
		ans += 1
if ans == N:
	ans = -1

print(ans)
c = input()

l = [chi(i) for i in range(65, 91)]
print(l[l.index(c) + 1])

### FIXED CODE ###

c = input()

l = [chr(i) for i in range(97, 123)]
print(l[l.index(c) + 1])
import numpy as np
N = int(input())
uvw = []
for i in range(N-1):
    u,v,w = map(int,input().split())
    uvw.append([u,v,w])

uvw = np.array(uvw)
uvw = uvw[np.argsort(uvw[:,0])]

# 初期の木の根とランクを設定（初めはみんな根なのでpar[i]=i）
par = [0 for i in range(N)]
dist = [0 for i in range(N)]
rank = [0 for i in range(N)]
for n in range(N):
    par[n] = n

# 木の根を探索する関数
# 根が自身でない場合は再帰的にたどる
# x,yが同じ集合に属するかの判定はroot(par[x])==root(par[y])か否か
def root(x):
    if par[x] == x:
        return x,d
    else:
        d += dist[]
        par[x], = root(par[x])
        return par[x],d

# 繋げる操作を指定された時に動かす関数
def unite(u,v,w):
    x = par[u]
    y = par[v]
    # rankが高い方に低い方を繋げる
    if rank[x] < rank[y]:
        par[x] = y
        dist[u] += w+dist[v]
    else:
        par[y] = x
        dist[v] += w+dist[u]
        # 同じだった場合xのランクが一つ増える扱いになる
        if rank[x] == rank[y]:
            rank[x] += 1

# 実際にクエリを受け取って動かす
for i in range(N-1):
    u,v,w = uvw[i,0],uvw[i,1],uvw[i,2]
    u = u-1
    v = v-1
    unite(u,v,w)

for i in range(N):
    ,d = root(i)
    if d % 2 == 0:
        print(0)
    else:
        print(1)


### FIXED CODE ###

N = int(input())
connect_list = [[] for i in range(N)]
for i in range(N-1):
    u,v,w = map(int,input().split())
    u -= 1
    v -= 1 
    connect_list[u].append([v,w])
    connect_list[v].append([u,w])

d = [0]+[-1 for i in range(N-1)]
stack = []
stack.append(0)
while len(stack) != 0:
    s = stack.pop()
    for x,w in connect_list[s]:
        if d[x] == -1:
            d[x] = d[s] + w
            stack.append(x)

for i in range(N):
    print(d[i]%2)
road = input()

right = 0
left = 0
flag = 0
ans = [0] * len(road)
for i in range(len(road)):
    if road[i] == 'L' and flag == 0:
        left = i
        flag = 1
        for j in range(right,i):
            
    if road[i] == 'R' and flag == 1:
        for j in range(right,i):
            if abs(j-left) % 2 == 1:
                ans[left] += 1
            else:
                ans[left-1] += 1
        right = i
        flag = 0
print(ans)
      

### FIXED CODE ###

road = input()
 
right = 0
left = 0
flag = 0
ans = [0] * len(road)
for i in range(len(road)):
    if road[i] == 'L' and flag == 0:
        left = i
        flag = 1
            
    if road[i] == 'R' and flag == 1 :
        for j in range(right,i):
            if abs(j-left) % 2 == 1:
                ans[left-1] += 1
            else:
                ans[left] += 1
        right = i
        flag = 0
for j in range(right,len(road)):
    if abs(j-left) % 2 == 1:
        ans[left-1] += 1
    else:
        ans[left] += 1
for a in ans:
    print(a,end=' ')
b=input()
if b=A:
  print("T")
if b=T:
  print("A")
if b=C: 
  print("G")
if b=G  
  print("C")

### FIXED CODE ###

b=input()
 
if b=='A':
    print('T')
elif b=='T':
    print('A')
elif b=='G':
    print('C')
else:
    print('G')
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
n = int(input())
a = list(map(int,input().split()))
x = 1
for i in range(n-1):
    x *= lcm(a[i],a[i+1])
Sum = 0
for i in range(n):
    Sum += (x-1)%a[i]
print(Sum)

### FIXED CODE ###

def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)
def lcm(x, y):
    return (x * y) // gcd(x, y)
n = int(input())
a = list(map(int,input().split()))
x = 1
for i in range(n-1):
    x *= lcm(a[i],a[i+1])
Sum = 0
for i in range(n):
    Sum += (x-1)%a[i]
print(Sum)
while True:
    num = int(input())
    if not num:
        break
    data = [input() for _ in range(num)]
    [print(el.replace('Hoshino', 'Hoshina')) for el in data]

### FIXED CODE ###

[print(input().replace('Hoshino', 'Hoshina')) for _ in range(int(input()))]
n = int(inputs[0])
*D, = map(int, inputs[1].split())
D.sort()
mod = 998244353

keys = [k for k, g in groupby(D)]
nodes = [len(list(g)) for k, g in groupby(D)]

if nodes[0] != 1:
    print(0)
else:
    patterns = [1]
    for i, (k, n0, n1) in enumerate(zip(keys, nodes, nodes[1:])):
        if i != k:
            print(0)
            break
        patterns.append(patterns[i] * pow(n0, n1, mod) % mod)
    else:
        print(patterns[-1])

### FIXED CODE ###

from collections import Counter
inputs = open(0).readlines()

n = int(inputs[0])
*D, = map(int, inputs[1].split())
mod = 998244353

nbs = [0] * (max(D)+1)
for k, v in Counter(D).items():
    nbs[k] = v

if D[0] != 0 or nbs[0] != 1:
    print(0)
else:
    ans = 1
    for n0, n1 in zip(nbs, nbs[1:]):
        ans = ans * pow(n0, n1, mod) % mod
    print(ans)
N = int(input())
S = input()
count = 0
for i in range(1, len(S)+1):
    for j in range(i + 1, len(S)+1):
        for k in range(j + 1, len(S)+1):
            if S[i-1] != S[j-1] and S[j-1] != S[k-1] and S[i-1] != S[k-1] and j - i != k - j:
                count += 1
print(count)

### FIXED CODE ###

N = int(input())
if "7" in str(N):
    print("Yes")
else:
    print("No")
n=map(int,input().split())
t= list(map(int,input().split()))

import sys
import collections
c = collections.Counter(t)
c=sorted(list(c.values()))
ans=0
delete_count=len(c)-k
if delete_count<=0:
    print(0)
else:
    for i in range(delete_count):
        if len(c)>k:
            ans+=c[i]
            
print(ans)
sys.exit()
        



### FIXED CODE ###

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

import sys
import collections
c = collections.Counter(t)
c=sorted(list(c.values()))
ans=0
delete_count=len(c)-k
if delete_count<=0:
    print(0)
    sys.exit()
else:
    for i in range(delete_count):
        if len(c)>k:
            ans+=c[i]
            
print(ans)
sys.exit()
n = int(input())
ans_list = [ 1 for i in range(n) ]

color_list = [ [0,-1] for i in range(10**5)] 
for i in range(n):
    color = int(input()) - 1

    if color_list[color][0] > 0 and color_list[color][1] not in [i-1,-1]:
        ans_list[i] = ans_list[i-1] + ans_list[color_list[color][1]]
    else:
        ans_list[i] = ans_list[i-1]
    ans_list[i] %= 10**9+7
    
    color_list[color][0] += 1
    color_list[color][1] = i
print(ans_list[-1])

### FIXED CODE ###


n = int(input())
ans_list = [ 1 for i in range(n) ]

color_list = [ -1 for i in range(2*(10**5))] 
for i in range(n):
    color = int(input()) - 1

    if color_list[color] not in [-1,i-1]:
        ans_list[i] = ans_list[i-1] + ans_list[color_list[color]]
    else:
        ans_list[i] = ans_list[i-1]
    ans_list[i] %= 10**9+7

    color_list[color] = i
print(ans_list[-1])
a=[]
import sys
for s in sys.stdin:
 s=s.strip()
 if s=='0 0':break
 a.append(s)
for t in a:
 print(*sorted(map(int,t)))

### FIXED CODE ###

import sys
for s in sys.stdin:
 if'0 0\n'==s:break
 print(*sorted(map(int,s.split())))
class unionFind:
    parent = []
    nums = []

    def __init__(self, n):
        self.parent = [i for i in range(n)]
        self.nums = [1]*n

    def root(self, x):
        if self.parent[x] == x:
            return(x)
        else:
            self.parent[x] = self.root(self.parent[x])
            return(self.parent[x])

    def same(self, x, y):
        x, y = x-1, y-1
        return(self.root(x) == self.root(y))

    def unite(self, x, y):
        x, y = x-1, y-1
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return
        else:
            self.parent[x] = y
            self.nums[y] += self.nums[x]
            self.nums[x] = 0
            return


N, M = map(int, input().split())
G = unionFind(N)
ans = [0]*M
ab = [tuple(map(int, input().split())) for i in range(M)]

tmp = (N * (N-1)) // 2
for i, x in enumerate(reversed(ab)):
    a, b = x[0], x[1]
    ans[M-1-i] = tmp
    a = G.root(a-1)
    b = G.root(b-1)
    if a == b:
        continue
    else:
        #tmp -= G.nums[a] * G.nums[b]
        G.parent[a] = b
        #G.nums[b] += G.nums[a]
        #G.nums[a] = 0


for i in range(M):
    print(ans[i])


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**5)


class unionFind:
    parent = []
    nums = []

    def __init__(self, n):
        self.parent = [i for i in range(n)]
        self.nums = [1]*n

    def root(self, x):
        if self.parent[x] == x:
            return(x)
        else:
            self.parent[x] = self.root(self.parent[x])
            return(self.parent[x])

    def same(self, x, y):
        x, y = x-1, y-1
        return(self.root(x) == self.root(y))

    def unite(self, x, y):
        x, y = x-1, y-1
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return
        else:
            self.parent[x] = y
            self.nums[y] += self.nums[x]
            self.nums[x] = 0
            return


N, M = map(int, input().split())
G = unionFind(N)
ans = [0]*M
ab = [tuple(map(int, input().split())) for i in range(M)]

tmp = (N * (N-1)) // 2
for i, x in enumerate(reversed(ab)):
    a, b = x[0], x[1]
    ans[M-1-i] = tmp
    a = G.root(a-1)
    b = G.root(b-1)
    if a == b:
        continue
    else:
        tmp -= G.nums[a] * G.nums[b]
        G.parent[a] = b
        G.nums[b] += G.nums[a]
        G.nums[a] = 0


for i in range(M):
    print(ans[i])
n=int(input())
a=list(map(int, input().split()))
count=0 
def h(L):
  for i in range(len(L)):
    if L[i] % 2 != 0:
      return 1
  return 0:
while h(a) == 0:
  for j in range(N):
    A[j]=A[j]/2
  count=count+1
  
print(count)

### FIXED CODE ###

n=int(input())
a=list(map(int, input().split()))
count=0 
def h(L):
  for i in range(len(L)):
    if L[i] % 2 != 0:
      return(1)
  return(0)
while h(a) == 0:
  for j in range(n):
    a[j]=a[j]/2
  count=count+1
  
print(count)
_1_1=[]
_1_2=[]
_1_3=[]
_2_1=[]
_2_2=[]
_2_3=[]
_3_1=[]
_3_2=[]
_3_3=[]
_4_1=[]
_4_2=[]
_4_3=[]
N=int(input())
s=[input() for i in range(N)]
bfrv=[]
for i in s:
    bfrv.append(i.split())
for i in bfrv:
    if int(i[0])==1 and int(i[1])==1:
        _1_1[int(i[2])-1]+=int(i[3])
    elif int(i[0])==1 and int(i[1])==2:
        _1_2[int(i[2])-1]+=int(i[3])
    elif int(i[0])==1 and int(i[1])==3:
        _1_3[int(i[2])-1]+=int(i[3])
    elif int(i[0])==2 and int(i[1])==1:
        _2_1[int(i[2])-1]+=int(i[3])
    elif int(i[0])==2 and int(i[1])==2:
        _2_2[int(i[2])-1]+=int(i[3])
    elif int(i[0])==2 and int(i[1])==3:
        _2_3[int(i[2])-1]+=int(i[3])
    elif int(i[0])==3 and int(i[1])==1:
        _3_1[int(i[2])-1]+=int(i[3])
    elif int(i[0])==3 and int(i[1])==2:
        _3_2[int(i[2])-1]+=int(i[3])
    elif int(i[0])==3 and int(i[1])==3:
        _3_3[int(i[2])-1]+=int(i[3])
    elif int(i[0])==4 and int(i[1])==1:
        _4_1[int(i[2])-1]+=int(i[3])
    elif int(i[0])==4 and int(i[1])==2:
        _4_2[int(i[2])-1]+=int(i[3])
    elif int(i[0])==4 and int(i[1])==3:
        _4_3[int(i[2])-1]+=int(i[3])
print(*_1_1)
print(*_1_2)
print(*_1_3)
print("#"*20)
print(*_2_1)
print(*_2_2)
print(*_2_3)
print("#"*20)
print(*_3_1)
print(*_3_2)
print(*_3_3)
print("#"*20)
print(*_4_1)
print(*_4_2)
print(*_4_3)


### FIXED CODE ###

_1_1=[]
_1_2=[]
_1_3=[]
_2_1=[]
_2_2=[]
_2_3=[]
_3_1=[]
_3_2=[]
_3_3=[]
_4_1=[]
_4_2=[]
_4_3=[]
for i in range(10):
    _1_1.append(0)
    _1_2.append(0)
    _1_3.append(0)
    _2_1.append(0)
    _2_2.append(0)
    _2_3.append(0)
    _3_1.append(0)
    _3_2.append(0)
    _3_3.append(0)
    _4_1.append(0)
    _4_2.append(0)
    _4_3.append(0)
N=int(input())
s=[input() for i in range(N)]
bfrv=[]
for i in s:
    bfrv.append(i.split())
for i in bfrv:
    if int(i[0])==1 and int(i[1])==1:
        _1_1[int(i[2])-1]+=int(i[3])
    elif int(i[0])==1 and int(i[1])==2:
        _1_2[int(i[2])-1]+=int(i[3])
    elif int(i[0])==1 and int(i[1])==3:
        _1_3[int(i[2])-1]+=int(i[3])
    elif int(i[0])==2 and int(i[1])==1:
        _2_1[int(i[2])-1]+=int(i[3])
    elif int(i[0])==2 and int(i[1])==2:
        _2_2[int(i[2])-1]+=int(i[3])
    elif int(i[0])==2 and int(i[1])==3:
        _2_3[int(i[2])-1]+=int(i[3])
    elif int(i[0])==3 and int(i[1])==1:
        _3_1[int(i[2])-1]+=int(i[3])
    elif int(i[0])==3 and int(i[1])==2:
        _3_2[int(i[2])-1]+=int(i[3])
    elif int(i[0])==3 and int(i[1])==3:
        _3_3[int(i[2])-1]+=int(i[3])
    elif int(i[0])==4 and int(i[1])==1:
        _4_1[int(i[2])-1]+=int(i[3])
    elif int(i[0])==4 and int(i[1])==2:
        _4_2[int(i[2])-1]+=int(i[3])
    elif int(i[0])==4 and int(i[1])==3:
        _4_3[int(i[2])-1]+=int(i[3])
print("",*_1_1)
print("",*_1_2)
print("",*_1_3)
print("#"*20)
print("",*_2_1)
print("",*_2_2)
print("",*_2_3)
print("#"*20)
print("",*_3_1)
print("",*_3_2)
print("",*_3_3)
print("#"*20)
print("",*_4_1)
print("",*_4_2)
print("",*_4_3)
from collections import Counter, defaultdict
n = int(input())
s= []
t = defaultdict(int)
for _ in range(n):
    s.append(input())
u = Counter(s)
m = int(input())
for _ in range(m):
    word = input()
    t[word] -= 1
    if word in u.keys():
        u[word] -= 1

ans = u.most_common(1)[0][1]
t = t.most_common(1)[0][1]
print(max(ans, t))


### FIXED CODE ###

from collections import Counter, defaultdict
n = int(input())
s= []
t = defaultdict(int)
for _ in range(n):
    s.append(input())
u = Counter(s)
m = int(input())
for _ in range(m):
    word = input()
    t[word] -= 1
    if word in u.keys():
        u[word] -= 1

ans = u.most_common(1)[0][1]
t = sorted(t.items(), key=lambda x:x[1], reverse=True)[0][1]
t = max(t, 0)
print(max(ans,t))
L = int(input())
if L%3 == 0:
  a == L/3
  print(a**3)
elif L%3 == 1:
  b = L/3 + 2/3
  c = (L - b)/2
  print(b*c**2)
else:
  pass

### FIXED CODE ###

L = int(input())
clue = L/3
ans = (L/3)**3
print(ans)
N = int(input())
A = list(map(int, input()))

top = 1
for a in A:
    top = top * a

bottom = 0
for i in range(N):
    bottom += top / A[i]

ans = top / bottom
print(round(ans, 6))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))

top = 1
for a in A:
    top = top * a

bottom = 0
for i in range(N):
    bottom += top / A[i]

ans = top / bottom
print(round(ans, 6))
b = input()
len = len(b)
ACGT = 0
MAX = 0
for i in range(b):
  if b[i]=="A" or b[i]=="C" or b[i]=="G" or b[i]=="T":
    ACGT += 1
  else:
    MAX = ACGT
    ACGT = 0
print(MAX)

### FIXED CODE ###

b = input()
len = len(b)
ACGT = 0
MAX = 0
flag = 0
for i in range(len):
  if b[i]=="A" or b[i]=="C" or b[i]=="G" or b[i]=="T":
    ACGT += 1
  else:
    if ACGT > MAX:
      MAX = ACGT
    ACGT = 0
if ACGT > MAX:
  MAX = ACGT
print(MAX)