peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N=int(input())
A=[int(input()) for i in range(N)]
count=0
count+=A[0]//2
A[0]%=2
for i in range(1,N):
    count+=(A[i-1]+A[i])//2
    if A[i]:
        A[i]=(A[i-1]+A[i])%2
    else:
        A[i]=0
print(count)
# Judge status: Accepted
X = int(input())
if X%1000:
  print(1000 - (X%1000))
else:
  print(0)
# Judge status: Wrong Answer
DoesExist = True

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

for i in range(len(As)):
    As[i] = int(As[i])

for num in range(len(As)):
    if As[num] > 2**num - 1:
        DoesExist = False

nodes_num = 0
nodes_limit = []

def nibungi():
    global nodes_num, nodes_limit, As
    nodes_num += N
    for i in range(len(As)):
        nodes_num += As[i]
    print(nodes_num)
    
if DoesExist == False:
    print("-1")
    
else:
    nibungi()
# Judge status: Accepted
import math
n = int(input())
lis = [int(input()) for i in range(5)]
print(math.ceil(n / min(lis)) + 4)
# Judge status: Accepted
n = int(input())
S = input()

rw = S.count('.')
rb = S.count('#')
lw = 0
lb = 0

ans = min(rb, rw)
for s in S:
    if s == '.':
        lw += 1
        rw -= 1
    else:
        lb += 1
        rb -= 1
    ans = min(ans, lb+rw)
print(ans)
# Judge status: Accepted
n, x, y = map(int, input().split())
x -= 1
y -= 1
k = [0] * n
for i in range(n-1):
  for j in range(i+1,n):
    m = min(abs(j-i), abs(x-i)+1+abs(y-j), abs(y-i)+1+abs(x-j))
    k[m] += 1

for i in range(1,n):
  print(k[i])
# Judge status: Wrong Answer
N = int(input())
S = [input() for _ in range(N)]
M = int(input())
T = [input() for _ in range(M)]

ans_list = []
for s in S:
  ans = 0
  ans += S.count(s)
  ans -= T.count(s)
  ans_list.append(ans)

print(max(ans_list))
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

s = 0
t = 99
for i in a:
  if t < n:
    s += c[t-1]
  s += b[i-1]
  t = i

print(s)
# Judge status: Accepted
A,B,N = (map(int , input().split()))
min(B-1,N)
x = min(B-1,N)
print(((A*x)//B - A * (x//B)))
# Judge status: Accepted
import math
a,b,c= map(int, input().split())
  
num = (c-a-b)**2

if(a+b > c):
  print("No")
elif(4*a*b < num):
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
s=str(input())
s=list(s)
ans=["x"]*len(s)
print(ans)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
N = int(input())
a = [0] * N
res = 0
for i in range(N):
  x = int(input())
  res += x // 2
  a[i] = x % 2
sch = []
for i in range(N - 1):
  if a[i] == a[i + 1] == 1: sch.append((i, i + 2))
sch.sort(key = lambda x: x[1])
x = 0
for i in range(len(sch)):
  if x <= sch[i][0]:
    res += 1
    x = sch[i][1]
print(res)
# Judge status: Accepted
n=int(input())
a=[0]*n
for i in range(0,n):
  a[i]=int(input())
temp=sorted(a,reverse=True)
for i in range(0,n):
  if a[i]==temp[0]:
    print(temp[1])
  else:
    print(temp[0])
# Judge status: Accepted
A, B = map(int, input().split())
S = input()

if S[:A].count('-') == 0 and S[A] == '-' and S[A + 1:].count('-') == 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
# B - Two Arrays
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
sum_a=sum(a)
sum_b=sum(b)

a_cnt,b_cnt=0,0

for aa,bb in zip(a,b):
    if aa>bb:
        a_cnt+=aa-bb
    elif aa<bb:
        b_cnt+=(bb-aa)//2

print('Yes') if a_cnt<=b_cnt else print('No')
# Judge status: Accepted
n,k=map(int,input().split())
ans=0
for i in range(1,n+1):
    score=i
    cnt=0
    while k>score>0:
        score*=2
        cnt+=1
    ans+=0.5**cnt
ans*=1/n
print(ans)
# Judge status: Wrong Answer
n=int(input())
r=[]
for _ in range(n):
    a,b=map(int,input().split())
    r.append([a+b,[a,b]])
r=sorted(r,reverse=True,key=lambda x:x[0])
print(abs(r[0][1][0]-r[-1][1][0])+abs(r[0][1][1]-r[-1][1][1]))
# Judge status: Wrong Answer
a, b = map(int, input().split())

print((b-a)*(b-a + 1)/2 - b)
# Judge status: Accepted
from decimal import Decimal
a,b,c = map(Decimal,input().split())
x = Decimal(0.5)
if a**x+b**x < c**x:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))

ans = 1
n -= k
k -= 1

if n % k == 0:
    ans += n // k
else:
    ans += n // k + 1

print(ans)
# Judge status: Wrong Answer
n=int(input())
p=1
while p<1e6:
 c=t=0;p+=1
 while n%p<1:n/=p;x=c==t;t+=x;c+=1-t*x
print(t+1-(n<2))
# Judge status: Accepted
D = input()

if D == '25':
    print('Christmas')
elif D == '24':
    print('Christmas Eve')
elif D == '23':
    print('Christmas Eve Eve')
elif D == '22':
    print('Christmas Eve Eve Eve')
# Judge status: Accepted
if __name__ == '__main__':
    n = int(input().strip())
    ans = 0

    for i in range(1, n + 1):
        limit = int(n / i)
        ans += limit * (limit + 1) * i / 2
    print(int(ans))
# Judge status: Wrong Answer
N = int(input())
A = map(int, input().split())

#current height
now = 0
total = 0

for a in A:
    print("a", a)

    if a >= now:
        now = a
        pass
    else:
        total += now - a
    #print("now", now)
    #print("total", total)

print(total)
# Judge status: Wrong Answer
N = int(input())
a = map(int, input().split())

a = sorted(a, reverse=True)

Alice = 0
Bob = 0

if N == 3:
    print((a[2] + a[0]) - a[1])

else:
    for i in range(0,N-1,2):
        Alice += a[i]
        Bob += a[i+1]
    
    print(Alice-Bob)
# Judge status: Accepted
a, b, c, k = map(int, input().split())

if a >= k:
    print(k)
elif a < k <= a+b:
    print(a)
elif a+b < k <= a+b+c:
    print(a-(k-a-b))
# Judge status: Accepted
Q, H, S, D = map(int, input().split())
N = int(input())
ans = (N // 2) * min(Q*8, H*4, S*2, D) + (N % 2) * min(Q*4, H*2, S)
print(ans)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
A,B = [int(i) for i in input().split()]
ans = "Yay!"
if A > 8 and B > 8 :
    ans = ":("
print(ans)
# Judge status: Wrong Answer
import bisect

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

T = [0]*N
for i in range(N):
    T[i] = int(input())
T.sort()

ans = 0
left = 0
while True:
    if left >= N:
        break
    #print("T[left]",T[left])
    ind = bisect.bisect_left(T, T[left]+K)
    #print("ind",ind)
    left = min(ind,left+C)
    ans += 1
    #print("left",left)
    
print(ans)
# Judge status: Accepted
# import sys
# readline = sys.stdin.readline
# generator = (readline().strip() for _ in range(N))

# N, M = map(int, input().split())
# As = list(map(int, input().split()))
# queries = (input() for _ in range(N))


def solve():
    N = int(input())
    v = N

    ans = ''

    while v > 0:
        d, m = divmod(v, 26)
        if m == 0:
            d -= 1
            m = 26
        ans = chr(m + 96) + ans
        v = d

    return ans


def main():
    print(solve())


if __name__ == "__main__":
    main()
# Judge status: Accepted
from collections import Counter

N, M = [int(_) for _ in input().split()]
A = [int(_) for _ in input().split()]

BC = [tuple([int(_) for _ in input().split()]) for _ in range(M)]

X = Counter(A)
for a in X:
    BC.append((X[a], a))
BC.sort(key=lambda x: x[1], reverse=True)

ans = 0
k = N
for b, c in BC:
    v = min(k, b)
    ans += v * c
    k -= v

print(ans)
# Judge status: Accepted
A, B, C, K = map(int, input().split())
if(A >= K): print(K)
elif(A + B >= K): print(A)
else: print(A - (K - (A + B)))
# Judge status: Wrong Answer
import numpy as np
N,K = map(int,input().split())
an = list(map(int,input().split()))

min_an_index = np.argmin(an)

a = min_an_index
b = N - min_an_index - 1

if K < a:
    b -= K - b
if K < b:
    a -= K - a
    
a1 = a // (K-1)
if a % (K-1) != 0:
    a1 += 1
    
b1 = b // (K-1)
if b % (K-1) != 0:
    b1 += 1

count = a1 + b1
print(count)
# Judge status: Wrong Answer
N, C, K = [int(x) for x in input().split()]

times = [int(input()) for x in range(N)]
times.sort()

count = 0
prev = None
passenger = 0

for t in times:
    passenger += 1
    if passenger == C:
        count += 1
        passenger = 0
    elif prev is not None:
        if t - prev > K:
            count += 1
            passenger = 1
    prev = t

if passenger:
    count += 1

print(count)
# Judge status: Accepted
import itertools

N,M,Q = list(map(int, input().split()))
numbers = [list(map(int,input().split())) for l in range(Q)]

#print(numbers)


suuretus = itertools.combinations_with_replacement(range(1, M+1), N)

ans = 0
for suuretu in suuretus:
    tmp = 0

    if len(suuretu) == N:
#        print(suuretu)
        for number in numbers:
            if suuretu[number[1]-1] - suuretu[number[0]-1] == number[2]:
                tmp += number[3]
        
    ans = max(ans, tmp)
#    print(ans)

print(ans)
# Judge status: Accepted
ch = list("abcdefghijklmnopqrstuvwxyz")

s = list(input())
t = list(input())
import numpy as np

s = np.array(s)
t = np.array(t)

flag = True
for i in ch:
  t_temp = (t[s == i])
  s_temp = (s[t == i])
  if len(set(t_temp)) > 1 or len(set(s_temp)) > 1:
    flag = False
    
if flag:print("Yes")
else:print("No")
# Judge status: Accepted
a, b, c = map(int, input().split())
if a == b and b == c:
    print(1)
elif a != b and b != c and c != a:
    print(3)
else:
    print(2)
# Judge status: Accepted
import sys
import itertools
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(read())
ans = 0
for i in range(1,N+1,2):
  count = 0
  for j in range(1,i+1):
    if i % j ==0:
      count += 1
  if count == 8:
    ans += 1
print(ans)
# Judge status: Accepted
N,X = map(int,input().split())

if N*500 >= X:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b = map(int,input().split())

if a*b <= 0:
  print("Zero")
elif a > 0:
  print("Positive")
else:
  if(b-a)%2 == 0:
    print("Negative")
  else:
    print("Positive")
# Judge status: Accepted
n = int(input())

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

ans = 0
var = 0

for i in range(n):
  var = a[var]-1
  if var == 1:
    ans = i+1
    break
if ans == 0:
  ans = -1
print(ans)
# Judge status: Accepted
n,w=map(int, input().split())
g=[0]
v=[0]
for i in range(n):
    G,V=map(int, input().split())
    g.append(G)
    v.append(V)

dp=[[0]*(w+1) for i in range(n+1)]

for i in range(1,n+1):
    for j in range(w+1):
        if j-g[i]>=0:dp[i][j]=max(dp[i-1][j],dp[i-1][j-g[i]]+v[i])
        else:dp[i][j]=dp[i-1][j]

print(dp[n][w])
# Judge status: Wrong Answer
a,b = map(int,input().split())
if a > 10 or b > 10:
    print(-1)
else:
    print(a * b)
# Judge status: Wrong Answer
a,b=map(int,input().split())

print(a//b+1)
# Judge status: Accepted
a,b,c=map(int,input().split())

if b-a==c-b:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
import sys
input = sys.stdin.readline

l = int(input())
ans = (l / 3) ** 3
print(ans)
# Judge status: Accepted
import math
n, k = map(int, input().split())
li = list(map(int, input().split()))
print(math.ceil((n-1)/(k-1)))
# Judge status: Accepted
S = list(input().strip())
n = len(S)
for i in range(n):
    if S[i] == '?':
        S[i] = 'D'
print(''.join(S))
# Judge status: Wrong Answer
weather=["Sunny","Cloudy","Rainy"]
print(chr(1+(weather.index(input()))))
# Judge status: Wrong Answer
o=list(input())
print(o)
e=list(input())
print(e)
for x,y in zip(o,e):print(x+y,end="")
# Judge status: Accepted
a, b, c, d = map(int, input().split())

result = -10**18
for x in [a, b]:
    for y in [c, d]:
        result = max(x * y, result)
print(result)
# Judge status: Accepted
N = int(input())
happy = [[0, 0, 0]]
for _ in range(N):
    happy.append(list(map(int, input().split())))

dp = [[0, 0, 0] for _ in range(N+1)]

for i in range(1,N+1):
    for today in range(3):
        for yesterday in range(3):
            if today == yesterday: continue

            dp[i][today] = max(dp[i][today], dp[i-1][yesterday] + happy[i][today])

print(max(dp[N][0], dp[N][1], dp[N][2]))
# Judge status: Accepted
n,k=map(int,input().split())
mati=list(map(int,input().split()))
count=0
i=mati[0]
matidic={}
frag=1
while frag:
    count+=1

    if i in matidic:
        frag=0
        bef=matidic[i]
        roop=count-bef

    else:
        matidic[i]=count
    i = mati[i - 1]

#print(roop,bef,matidic)
#print(k%roop)
if bef<k:
    ans=[i for i,j in matidic.items() if j==(k-bef)%roop+bef]
else:
    ans=[i for i,j in matidic.items() if j==k]
print(ans[0])
# Judge status: Accepted
N=int(input())
s=input()
ans = s
flag_A = True
r = 0
l = 0
while flag_A:
    flag_B =False
    for n,i in enumerate(s):
        if n != len(s)-1 and i =="(" and s[n+1] ==")":
            s = s[:n]+s[n+2:]
            flag_B = True
            break
    if not flag_B:
        flag_A = False
for i in s:
    if i ==")":
        r += 1
    else:
        l += 1
print("("*r+ans+")"*l)
# Judge status: Accepted
N, M = map(int, input().split())
A = list(map(int, input().split()))
B = [[0]*2 for i in range(M+N)]
for i in range(M):
  B[i] = list(map(int, input().split()))
for i in range(N):
  B[M+i] = [1, A[i]]
B=sorted(B ,key=lambda x:x[1],reverse=True)
i = 0
cnt = 0
ans = 0
while(cnt < N):
  if(cnt + B[i][0] < N):
    ans += B[i][0] * B[i][1]
    cnt += B[i][0]
  else:
    ans += (N - cnt) * B[i][1]
    cnt = N
  i += 1
print(ans)
# Judge status: Accepted
n,t=map(int, input().split())
m=10**9
ans=m
for _ in range(n):
  ci,ti=map(int, input().split())
  if ti<=t:
    ans=min(ans,ci)
print(ans if ans<m else "TLE")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
c = 0
for hoge in a:
  c += hoge
avg = c/2
t = 0
s = 0
while t < avg:
  t += a[s]
  s += 1
ans = min(abs(avg-t-a[s-1]),abs(avg-t),abs(t+a[s]-avg))
print(int(ans*2))
# Judge status: Accepted
L,R=map(int,input().split())
k = 0
l = 2020
m = 2020
apList = [0]*2019
for i in range(L,R+1):
  k = i % 2019
  if apList[k] != 0:
    break
  else:
    apList[k] += 1
res = 2018
for i in range(2019):
  for j in range(i+1,2019):
    if apList[i] != 0 and apList[j] !=0:
      res = min(i*j %2019,res)
print(res)
# Judge status: Accepted
s=input()
count=0
if s[0]=='1':
  count=count+1
if s[1]=='1':
  count=count+1
if s[2]=='1':
  count=count+1
print(count)
# Judge status: Accepted
s = list(input())

thresh_1 = int((len(s) - 1) / 2)
thresh_2 = int((len(s) + 3) / 2)

s_1 = s[:thresh_1]
s_2 = s[thresh_2 - 1:]

if s == s[::-1] and s_1 == s_1[::-1] and s_2 == s_2[::-1]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys
# sys.setrecursionlimit(100000)


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    S = input()
    tmp = ""
    prev = ""
    cnt = 0
    for s in S:
        tmp += s
        if tmp != prev:
            cnt += 1
            prev = tmp
            tmp = ""
        elif tmp == prev:
            continue

    print(cnt)

    return


if __name__ == "__main__":
    main()
# Judge status: Accepted
N = int(input())
result = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}
for i in range(N):
    S = input()
    result[S] += 1
print('AC x ' + str(result['AC']))
print('WA x ' + str(result['WA']))
print('TLE x ' + str(result['TLE']))
print('RE x ' + str(result['RE']))
# Judge status: Wrong Answer
# 2020-04-29
x = 0
lst = [0]
n = int(input())
s = list(input())

for i in range(n-1):
    if s[i] == 'I':
        x += 1
        lst.append(x)
    else:
        x -= 1
        lst.append(x)

        print(max(lst))
# Judge status: Accepted
n=int(input())
d=list(map(int,input().split()))
d.sort()
print(d[n//2]-d[n//2-1])
# Judge status: Accepted
import sys
row = sys.stdin.readline
def read_int(row):
    return int(row().rstrip())

A,B= [read_int(row) for i in range(2)]

print((set({1,2,3}) - set({A,B})).pop())
# Judge status: Accepted
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n,k,q = list(map(int, input().split()))
a = [int(input()) for _ in range(q)]
vs = [k-q]*n
for i in range(q):
    vs[a[i]-1] += 1
for i in range(n):
    if vs[i]>0:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
N = int(input())
for i in range(1,50001):
  if i*108//100 == N:
    print(i)
    exit()
print(':(')
# Judge status: Accepted
A,B,M=map(int,input().split())
L_A=list(map(int,input().split()))
L_B=list(map(int,input().split()))
ans=min(L_A)+min(L_B)
for i in range(M):
	X,Y,Z=map(int,input().split())
	ans=min(ans,(L_A[X-1]+L_B[Y-1]-Z))
print(ans)
# Judge status: Wrong Answer
A, B, C, K = map(int, input().split())

ans = 0

if A >= K:
    print(K)
elif A + B >= K:
    print(A)
else:
    print(A - K)
# Judge status: Accepted
N,M=map(int, input().split())

sc = []
for i in range(M):
    sc.append(list(map(int, input().split())))
for i in range(10**N):
    ans = str(i)
    if len(ans) == N and all(ans[s-1] == str(c) for s,c in sc):
        print(ans)
        quit()
print(-1)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
ans = [0]*N

for i in range(N):
    tmp = A[i]
    ans[tmp-1] = i

for j in range(N):
    ans[j] += 1

print(*ans)
# Judge status: Accepted
s=input()
t=input()
ans=1000
for i in range(len(s)-len(t)+1):
    cnt=0
    for j in range(len(t)):
        if s[i+j]!=t[j]:
            cnt+=1
    ans=min(ans,cnt)
print(ans)
# Judge status: Wrong Answer
a=[input() for i in range(2)]
P=a[0]
S=a[1]
count=0
for t in range(0,len(P)-1):
  if P[t] == S[t]:
    count=count+1
print(count)
# Judge status: Accepted
L = int(input())

ans = (L / 3) ** 3
print(ans)
# Judge status: Wrong Answer
def compute_score(sub):
    max_i = max(sub)
    min_i = min(sub)
    score = max_i * (max_i + 1) * (1 /2) + min_i * (min_i - 1) * (1/2)
    return score

S = input()
sub = [0, 0]
ans = 0
flag = False
for s in S:
    if s == '<' and flag:
        ans += compute_score(sub)
        sub = [0, 0]
        flag = False
    if s == '>':
        flag = True
    if s == '<':
        sub[0] += 1
    else:
        sub[1] += 1
ans += compute_score(sub)
print(ans)
# Judge status: Accepted
def main():
    n = int(input())
    a = list(map(int,input().split()))
    d = {}
    for i in range(n):
        if d.get(a[i]) == None:
            d[a[i]] = 1
        else:
            d[a[i]] += 1
    ans = 0
    for k in d.keys():
        ans += d[k] * (d[k]-1) //2
    for i in range(n):
        print(ans - ((d[a[i]]*(d[a[i]]-1))//2 - (d[a[i]]-1) * (d[a[i]]-2)//2))

if __name__ == "__main__":
    main()
# Judge status: Accepted
def main():
    K, S = open(0).read().split()
    K = int(K)

    ans = ''
    len_S = len(S)
    if len_S <= K:
        ans = S
    else:
        ans = S[:K] + '.' * 3

    print(ans)
    return(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
a=str(input())
sum=0
if a[0]=="1":
   sum+=1
if a[1]=="1":
   sum+=1
if a[2]=="1":
   sum+=1
print(sum)
# Judge status: Accepted
s = input()
t = input()
x = len(s)-len(t)
ans = 10**9
for i in range(x+1):
    cnt = 0
    for j in range(len(t)):
        if s[i+j] != t[j]:
            cnt += 1
    ans = min(ans, cnt)
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
total = sum(A)
mid = total // 2
sum_left, sum_left2 = 0, 0
seperation_i = 0
for i, l in enumerate(A[:-1]):
  sum_left += l
  if sum_left >= mid:
      seperation_i = i
      sum_left2 = sum_left - l
      break
sum_right, sum_right2 = sum(A[seperation_i + 1:]), sum(A[seperation_i:])
print(min(abs(sum_right - sum_left), abs(sum_right2 - sum_left2)))
# Judge status: Wrong Answer
n = str(input())
print(n[-1])


if n[-1]=='2' or n[-1]=='4' or n[-1]=='5' or n[-1]=='7' or n[-1]=='9':
    print('hon')
elif n[-1]=='0' or n[-1]=='1' or n[-1]=='6' or n[-1]=='8':
    print('pon')
else:
    print('bon')
# Judge status: Accepted
#import numpy as np
import sys
import math
from collections import defaultdict
import itertools
read = sys.stdin.buffer.read
readline = sys.stdin.readline
readlines = sys.stdin.buffer.readlines

N = int(input())
coordinate = []
[coordinate.append(list(map(int,input().split()))) for _ in range(N)]

ans = 0
fa = 0

for x in list(itertools.permutations( [i for i in range(1,N+1)] , N)):
    for i in range(N-1):
        xx = coordinate[x[i]-1][0] - coordinate[x[i+1]-1][0]
        y = coordinate[x[i]-1][1] - coordinate[x[i+1]-1][1]
        ans += math.sqrt(xx**2 + y ** 2)
    fa += 1
print(ans/fa)
# Judge status: Accepted
import math
n=int(input())
print(int(360/math.gcd(n,360)))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
x1 = []
x2 = []
x4 = []
for i in range(n):
    if a[i] % 4 == 0:
        x4.append(a[i])
    elif a[i] % 2 == 0:
        x2.append(a[i])
    else:
        x1.append(a[i])
if len(x2) == 0:
    if len(x1) <= len(x4)+1:
        print("Yes")
    else:
        print("No")
else:
    if len(x1) <= len(x4):
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
n = int(input())
s = []
for i in range(n):
  s.append(input())
  
m = int(input())
t = []
for i in range(m):
  t.append(input())

count = 0
for i in range(n):
  count = s.count(s[i]) - t.count(s[i]) if count < s.count(s[i]) - t.count(s[i]) else count
print(count)
# Judge status: Accepted
X, A, B = map(int, input().split())
if B <= A:
    print('delicious')
elif B <= A + X:
    print('safe')
else:
    print('dangerous')
# Judge status: Accepted
from sys import stdin
N,K,S = [int(x) for x in stdin.readline().rstrip().split()]

if S == 10**9:
    ans = [S]*K + [1]*(N-K)
else:
    ans = [S]*K + [S+1]*(N-K)
for i in ans:
    print(i,end=" ")
# Judge status: Accepted
n = int(input())
a = n // 4
b = n // 7
flag = 0
for i in range(a+1):
  for j in range(b+1):
      if (i*4+j*7)==n:
        flag = 1
if flag==1:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
from collections import Counter
w = [c for c in str(input())]
ans = 'Yes'
for k, v in Counter(w).items():
    if v % 2 == 1:
        ans = 'No'
        break
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
r, s, p = map(int, input().split())
d = {"r": p, "s": r, "p": s}
t = input()

ans = 0
prev = ["#" for _ in range(k)]
for i, move in enumerate(t):
    if prev[i%k] != move:
        ans += d[move]
        prev[i%k] = move
    else:
        prev[i%k] = "#"
print(ans)
# Judge status: Wrong Answer
#graph implementation
import math
n,m=map(int,input().split())
ans=[0]*n
for i in range(m):
    s,c=map(int,input().split())
    if ans[s-1]==0:
            ans[s-1]=c
    else:
        if ans[s-1]>=c and c>0:
            ans[s-1]=c
if ans[0]==0 and len(ans)<3:
    for i in ans:
        print(i,end="")
elif ans[0]==0:
    print(-1)
else:
    for i in ans:
        print(i,end="")
#print(ans)
# Judge status: Accepted
# 1<=a,b<=10000
# a,bは整数

#number = input('整数を入力してね > ')
#print (number)
a, b = map(int, input().split())
#print(a, b)
c = a * b
#print(c)
d=c%2
if d==0:
    print('Even')
if d==1:
    print('Odd')
# Judge status: Accepted
N, D = map(int, input().split())
res = 0
for i in range(N):
  x, y = map(int, input().split())
  if not (x ** 2) + (y**2) > D ** 2:
    res += 1
print(res)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

dp = [[0,0] for i in range(n+1)]

dp[0][0]= 0 
dp[0][1]= -10**10

for i in range(1,n+1):
    dp[i][1]= max(dp[i-1][0]-a[i-1], dp[i-1][1]+a[i-1])
    dp[i][0]=max(dp[i-1][0]+a[i-1], dp[i-1][1]-a[i-1])


print(dp[n][0])
# Judge status: Accepted
a,b,c=map(int, input().split())
t=0
if a==5:
  if b==5:
    if c==7:
      t=1
  elif b==7:
    if c==5:
      t=1
elif a==7:
  if b==5:
    if c==5:
      t=1
if t==1:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
from fractions import gcd

a, b = map(int, input().split())
print(a * b // gcd(a, b))
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
input = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines  

N = int(input())
S = input()

ans = "No"
if S[:(N//2)] == S[(N//2):]:
  ans = "Yes"
print(ans)
# Judge status: Wrong Answer
a,b,t=map(int,input().split())
for i in range(20):
    if a*i < t+1:
        k=i
    else:
        break      
print(b*k)
# Judge status: Accepted
import numpy as np

N = int(input())
A = np.array(list(map(int, input().split())))
mod = 10**9+7
ans = 0
for i in range(60):
    b1 = np.count_nonzero(A>>i&1)
    ans += 2**i*b1*(N-b1)
    ans %= mod
print (ans)