peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n = int(input())
a = [ai for ai in map(int, input().split())]
res = dict((i, 0) for i in range(n))
for ai in a:
    res[ai-1] += 1
for i in res.values():
    print(i)
# Judge status: Wrong Answer
import numpy as np
A,B = list(map(float, input().split()))
print(np.trunc(A*B))
# Judge status: Wrong Answer
def ABC_131_A():
    S = input()
    if S.count(S[0])>=2 or S.count(S[1])>=2 or S.count(S[2])>=2:
        print('Bad')
    else:
        print('Good')

if __name__ == '__main__':

    ABC_131_A()
# Judge status: Accepted
a = input()
oomoji = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
komoji = "abcdefghijklmnopqrstuvwxyz"
if a in oomoji:
    print("A")
else:
    print("a")
# Judge status: Accepted
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    K, S = map(int, sys.stdin.readline().split())

    ret = 0
    for x in range(K + 1):
        for y in range(K + 1):
            if S - x - y <= K and S - x - y >= 0:
                ret += 1
    print(ret)


if __name__ == '__main__':
    main()
# Judge status: Accepted
a,b =  map(int,input().split())
cnt = 0

for i in range(b-a+1):
    r = str(a+i)[::-1]
    if a+i == int(r):
        cnt += 1
print(cnt)
# Judge status: Accepted
#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  n, l = map(int, input().strip().split())
  if l <= 0 <= l+n-1:
    print(l*n + ((n * (n-1))//2))
  elif l < 0:
    print(l*(n-1) + (((n-1) * (n-2))//2))
  elif l > 0:
    print(l*(n-1) + ((n * (n-1))//2))

if __name__=='__main__':
  main()
# Judge status: Accepted
import numpy as np
import sys
import math

N = input()
a = N[::-1][0]

if a == "3":
    print("bon")
elif a == "0" or a == "1" or a == "6" or a == "8":
    print("pon")
else:
    print("hon")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
odd = a[::2]
even = a[1::2]
even.reverse()
ans = even + odd
if n % 2:
  ans.reverse()
  
print(" ".join(list(map(str, ans))))
# Judge status: Accepted
s=input()
fin=""
for c in s:
    if c=='1':
        fin+="1"
    elif c=='0':
        fin+="0"
    else:
        if len(fin)>0:
            fin=fin[:-1]
print(fin)
# Judge status: Wrong Answer
import numpy as np

N, K = map(int, input().split())
A = np.array(list(map(int, input().split())))
#A = np.array([0] * N)
#print(A)
cnt = 0

for _ in range(K):
  B = np.array([0] * N)
  stop = 0
  for i in range(N):
    p = A[i]
    L = max(i-p, 0)
    R = min(i+p, N-1)
    for j in range(L, R+1):
      B[j] += 1
      if B[j] == N:
        stop += 1
  cnt += 1
  A = B
  #print(A)
  if stop == N:
    #print(cnt)
    break

print(A)
# Judge status: Wrong Answer
def main():
    a, b = list(map(int, input().split()))
    ans = a + b
    if ans > 24:
        print(24-ans)
    else:
        print(ans)



if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n, b, r = map(int, input().split())
print((n //(b+r))*b + n - (b+r)*(n //(b+r)))
# Judge status: Accepted
a,b,c=sorted(map(int,input().split()))
print(10*c+a+b)
# Judge status: Accepted
s=input()
t=input()
res=0
for i in range(len(s)):
    if s[i]!=t[i]:res+=1
print(res)
# Judge status: Wrong Answer
a,b,c,d = map(int,input().split())
if a > c:
    if c + d >= a:
        ans = min(b-a, c+d-a)
    else:
        ans = 0
elif a == c:
    ans = min(b, d)
else:
    if a + b >= c:
        ans = min(d-c,a+b-c)
    else:
        ans = 0
print(ans)
# Judge status: Accepted
A, B, C = list(map(int, input().split()))
if A + B >= C:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n,x=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
cnt=0
if sum(a)==x:
    print(n)
    exit()
else:
    for i in range(n-1):
        if a[i]<=x:
            x-=a[i]
            cnt+=1
print(cnt)
# Judge status: Wrong Answer
N,M,K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
k=0
ans=0
a=0
b=0
for i in range(N+M+1):
  if a==N and b==M:
    break
  elif a==N:
    k+=B[b]
    b+=1
  elif b==M:
    k+=A[a]
    a+=1
  else:
    if A[a]>=B[b]:
      k+=B[b]
      b+=1
    else:
      k+=A[a]
      a+=1
  if k<=K:
    ans+=1
  else:
    break
print(ans)
# Judge status: Accepted
N=int(input())
dic={}
for i in range(1,N+1):
    dic[i]=0
for x in range(1,int(N**0.5)):
    for y in range(1,N-x**2):
        for z in range(1,N-(x**2+y**2+x*y)):
            if x**2+y**2+z**2+x*y+x*z+y*z>N:break
            if x**2+y**2+z**2+x*y+x*z+y*z in dic:
                dic[x**2+y**2+z**2+x*y+x*z+y*z]+=1


for i in range(1,N+1):
    print(dic[i])
# Judge status: Wrong Answer
n,k=map(int,input().split())
p=list(map(int,input().split()))
sum_p=[]
wk_sum_p=[]
for i in range(n):
  wk_sum_p.append(p[i])
  if len(wk_sum_p)==k:
    sum_p=wk_sum_p.copy()
  elif len(wk_sum_p)>k:
    if wk_sum_p[0]<wk_sum_p[k]:
      sum_p=wk_sum_p[1:k+1].copy()
    del wk_sum_p[0]
ans=0
for val in sum_p:
  div=val//2
  if val%2==0:
    ans+=(1+val)*div/val
  else:
    ans+=((2+val)*div+1)/val
print(ans)
# Judge status: Wrong Answer
w,h,x,y = map(int,input().split())

big = max(w,h) * (min(w,h)/2)

if min(w,h)/2 == x and min(w,h)/2 == y:
    print(big)
    print(1)
elif x == 0 and x == 0 or x == w and x == 0 or x == w and x == h or x == 0 or x == h:
    print(w*h)
    print(1)
else:
    print(big)
    print(0)
# Judge status: Accepted
n,m = map(int, input().split())
rl = [0]*n
for i in range(m):
    a,b = map(int, input().split())
    rl[a-1]+=1
    rl[b-1]+=1
for i in rl:
    print(i)
# Judge status: Accepted
a,b=map(int,input().split())
ans=max(a,b)
if ans==a:
    a=a-1
else:
    b=b-1
ans+=max(a,b)
print(ans)
# Judge status: Wrong Answer
a,b=map(int,input().split())
if ((a*b)%2) == 0:
  print('even')
else:
  print('Odd')
# Judge status: Accepted
n = input()

if '9' in n:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n,k=list(map(int,input().split()))
print(-(-(n-k)//(k-1))+1)
# Judge status: Accepted
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
a = LI()
m = a[0]
ans = 0
for i in range(1, n):
    if a[i] <= m:
        ans += m - a[i]
    else:
        m = a[i]
print(ans)
# Judge status: Wrong Answer
def dfs(i, f):
  if i == n - 1:
    total = sum(list(map(int, f.split('+'))))
    if total == 7:
      print((f + '=7').replace('+-', '-'))
    return total
  return dfs(i + 1, f + '+' + s[i + 1]) + dfs(i + 1, f + '+-' + s[i + 1])

s = input()
n = len(s)
dfs(0, s[0])
# Judge status: Accepted
n,k = map(int,input().split())
a = list(map(int,input().split()))
import math
if k == n:
    print(1)
else:
    print(1+math.ceil((n-k)/(k-1)))
# Judge status: Accepted
s = input()
if s[0]==s[1] and s[0]!=s[2] and s[2]==s[3]:
    print("Yes")
elif s[0]==s[2] and s[0]!=s[1] and s[1]==s[3]:
    print("Yes")
elif s[0]==s[3] and s[0]!=s[1] and s[1]==s[2]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def main():
    N = int(input())
    H = [int(x) for x in input().split()]
    k = True
    for i in range(1, N):
        if H[i] >= H[i-1]:
            if H[i] - 1 >= H[i - 1]:
                H[i] = H[i] - 1
        else:
            k = False
            break
    if k:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
import sys
S=input()
s=[]
for i in S:
    s.append(i)
x=[chr(i) for i in range(97,97+26)]
s.sort()
for i in range(len(s)):
    if s[i]!=x[i]:
        print(x[i])
        sys.exit()
print("None")
# Judge status: Accepted
N = int(input())
S = list(map(str, input()))

# 相手がいない()をカウントすればいい
left_stock = 0
left_short = 0

for s in S:
	if s == "(":
		left_stock += 1
	else:
		if left_stock > 0:
			left_stock -= 1
		else:
			left_short += 1
			
for _ in range(left_short):
	print("(", end = "")
for s in S:
	print(s, end = "")
for _ in range(left_stock):
	print(")", end = "")
# Judge status: Accepted
from math import gcd
K = int(input())
ans = 0
for i in range(1, K+1):
    for j in range(1, K+1):
        a = gcd(i, j)
        for k in range(1, K+1):
            ans += gcd(a, k)
print(ans)
# Judge status: Accepted
S = int(input())
dp = [0] * (S + 1)
mod = pow(10, 9) + 7

for i in range(0, S + 1):
    if i == 0:
        dp[i] = 1
        continue
    if i < 3:
        # dp[i] = 0
        continue
    dp[i] += (dp[i - 3] + dp[i - 1]) % mod 
print(dp[S])
# Judge status: Accepted
n, k, s = map(int, input().split())

if s == 10 ** 9:
    ans = [s] * k + [1] * (n - k)
else:
    ans = [s] * k + [s + 1] * (n - k)

print(*ans)
# Judge status: Accepted

n = int(raw_input())
points = set([])
for _ in range(n):
	p = map(int, raw_input().split())
	points.add(tuple(p))
points = list(points)
def distance(p,q): return abs(p[0] - q[0]) + abs(p[1] - q[1])


def f(points):
	r = 0
	for u in [-1,1]:
		for v in [-1,1]:
			pps = [u*x + v*y for x,y in points]
			r = max(r, max(pps) - min(pps))
	return r
print f(points)
# Judge status: Accepted
N = int(input())

lucas = [2,1]
for i in range(2,N+1):
    lucas_num = lucas[i-1] + lucas [i-2]
    lucas.append(lucas_num)
print(lucas[-1])
# Judge status: Accepted
import sys
input = sys.stdin.readline

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

leaf = sum(A)
ans = 0
node = 1
for i in range(N+1):
    if A[i] > node or leaf == 0:
        ans = -1
        break
    ans += node
    leaf -= A[i]
    node = min(2*(node-A[i]), leaf)
print(ans)
# Judge status: Accepted
s=input()
a={"SUN":7,"MON":6,"TUE":5,"WED":4,"THU":3,"FRI":2,"SAT":1}
print(a[s])
# Judge status: Wrong Answer
n = int(input())
import numpy as np
argList = np.array(list(map(int, input().split())))
flagList = [True]*n 

for i in range(n):
    flagList[i] = False
    print(int(np.median(argList[flagList])))
    flagList[i] = True
# Judge status: Accepted
from statistics import median

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

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

b = int(median(A))
ans = 0

for a in A:
  ans += abs(a-b)

print(ans)
# Judge status: Accepted
a, b = map(int, input().split())
ans = 'Yay!'
if a > 8 or b > 8:
    ans = ':('
print(ans)
# Judge status: Wrong Answer
n = int(input())
mod = 10**9+7
total = 1
for i in range(1,n+1):
    total *= i%mod

print(total)
# Judge status: Accepted
A, B, K = map(int, input().split())
print(max(0, A - K), max(0, min(A + B -K, B)))
# Judge status: Wrong Answer
n, a, b = map(int,input().split())

if (b-a)%2 == 0:
    print(int((b-a)/2))
else:
    if a-1 < n-b:
        print(int((a+b-1)/2))
    else:
        print(int((n-a + n-b + 1)/2))
# Judge status: Accepted
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


n, k, s = LI()
a = []
for _ in range(k):
    a.append(s)
for _ in range(n - k):
    if s == 1:
        a.append(s + 1)
    else:
        a.append(s - 1)
print(*a)
# Judge status: Accepted
def solve():
    S = input()
    tmp = ''
    ans = 0
    i = 0
    while i < len(S):
        s = S[i]
        if s != tmp:
            ans += 1
            i += 1
            tmp = s
        else:
            ans += 1 if i != len(S) - 1 else 0
            i += 2
            tmp = ''
    print(ans)
    
if __name__ == "__main__":
    solve()
# Judge status: Wrong Answer
hen = list(map(int, input().split()))

naname = max(hen)

if naname == hen[0]: print(hen[1]*hen[2]/2)
elif naname == hen[1]: print(hen[0]*hen[2]/2)
else: print(hen[1]*hen[0]/2)
# Judge status: Wrong Answer
from collections import deque,Counter
import bisect
n,*a = map(int,open(0).read().split())
c = Counter(a)
c = sorted(c.items())
a = deque(c)
p_set = set()
ans,r = 0,0
while a:
    f,count = a.popleft()
    if count == 1:
        z = []
        for u in range(len(a)):
            if a[u][0]%f != 0:
                z.append(a[u])
        a = deque(z[:])
    else:
        r += 1
    p_set.add(f)
print(len(p_set)-r)
# Judge status: Wrong Answer
s = input()

n = len(s)

if (n//2) % 2 == 0 or n == 3:
    print("No")
    exit()

t = 0
for i in range(n//2):
    if s[i] != s[-i-1]:
        print("No")
        exit()

for j in range((n//2) // 2):
    if s[j] != s[-j-(n//2)-2]:
        print("No")
        exit()

for j in range((n//2) // 2):
    if s[j+(n//2)+1] != s[-j-1]:
        print("No")
        exit()

print("Yes")
# Judge status: Accepted
n = int(input())
ans = 0
i = 1
while i <= n:
    if i % 3 != 0 and i % 5 != 0:
        ans += i
    i += 1
print(ans)
# Judge status: Accepted
import math
n = int(input())
a = list(map(int, input().rstrip().split()))
s = sum(a)
t1 = 0
t2 = 0
mean1 = s // n
mean2 = mean1 + 1
for x in a:
    t1 += math.pow(abs(x - mean1), 2)
    t2 += math.pow(abs(x - mean2), 2)
print(int(min(t1, t2)))
# Judge status: Wrong Answer
N,M = map(int,input().split())
n = M // N
m = 0
for i in range(1,10**5):
    x = i
    if M % x == 0:
        if M//x <= n:
            print(M//x)
            quit()
        m = x
print(m)
# Judge status: Accepted

import collections
from functools import lru_cache


def read():
    return input().strip()


def readInt():
    return int(input().strip())


def readList():
    return list(map(int, input().strip().split()))


def solve(n, arr):
    ans = 0

    for i, val in enumerate(arr, 1):
        if i & 1 and val & 1:
            ans += 1

    return ans


n = readInt()
arr = readList()

print(solve(n, arr))
# Judge status: Wrong Answer
import itertools

N,M,Q=list(map(int,input().split()))

for i in range(Q):
  abcd=[list(map(int,input().split()))]
 #重複組み合わせ

result=0
for A in itertools.combinations_with_replacement(range(1,M+1),N):
  t=0
  for a,b,c,d in abcd:
    if A[b-1]-A[a-1]==c:
      t+=d
  result=max(result,t)
print(result)
# Judge status: Wrong Answer
a = list(map( int, input().split() ))

if sum(a) > 22:
  print("bust")
else:
  print("win")
# Judge status: Wrong Answer
N=int(input())
b=0
for i in range(1,26):
    for j in range(1,16):
        if 4*i+7*j==N:
            b+=1
if b!=0:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
a = int(input())
d =0
if a ==1:
  print(2)
elif a==2:
  print(1)
else:
  b,c =2,1
  for i in range(3,a+2):
    d =b+c
    b,c =c,d
  print(d)
# Judge status: Wrong Answer
N= int(input())
n = N % 10
print(n)
if n == 2 or n==4 or n ==5 or n == 7 or n == 9:
  print('hon')
elif n == 0 or n ==1 or n == 6 or n == 8:
  print('pon')
elif n == 3:
  print('bon')
# Judge status: Accepted
import fractions

A,B,C,D = map(int,input().split())
m2 = B//C - (A-1)//C
m3 = B//D - (A-1)//D
m6 = B//(C*D//fractions.gcd(C,D)) - (A-1)//(C*D//fractions.gcd(C,D))
print(B-A+1-(m2+m3-m6))
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
print("No" if a<b<c or a>b>c else "Yes")
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=[i for i in a if i%2==0]
c=[k for k in a if k%6==0 or k%10==0]
if len(b)==len(c):
     print('APPROVED')
else:
     print('DENIED')
# Judge status: Accepted
K =int(input())

print( (K//2)*(K - (K//2)))
# Judge status: Accepted
NM= input ().split()
N= int (NM[0])
M= int (NM[1])
if (N==M):
    print ("Yes")
else:
    print ("No")
# Judge status: Wrong Answer
import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり


N,P = MI()
A = LI()

x = sum(A[i] & 0 for i in range(N))  # Aiの中で、偶数であるものの個数
y = N-x  # Aiの中で、奇数であるものの個数

if y == 0:
    print(0 if P == 1 else 2**x)
else:
    print(2**(x+y-1))
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

s = 0
ans = 0
while s <= N-1:
  i = s
  temp = 0
  while i <= N-2 and A[i] >= A[i+1]:
    temp += 1
    i += 1
  ans = max(ans,temp)
  s = i+1
print(ans)
# Judge status: Wrong Answer
x,a,b = map(int,input().split())
print('delicious') if b-a<0 else print('safe') if b-a<x else print('dangerous')
# Judge status: Accepted
N,M = map(int,input().split())
X = list(map(int,input().split()))
X.sort()

dist = [0]*(M-1)
for i in range(0,M-1):
  dist[i] += X[i+1] - X[i]
  
dist.sort(reverse = True)

print(sum(dist[N-1:]))
# Judge status: Wrong Answer
N = int(input())
S = list(input())
i = N/2

if N % 2 != 0:
    print("No")
    exit()
if S[:int(i-1)] == S[int(i):int(N-1)]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def main():
    from string import ascii_lowercase
    N = int(input())

    ans = []
    while N > 0:
        N -= 1
        N, i = divmod(N, 26)
        ans.append(ascii_lowercase[i])

    ans = ''.join(reversed(ans))

    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
x,a,b=map(int,input().split())
print("YES" if (10*a+b)%4==0 else "NO")
# Judge status: Accepted
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

if K >= N:
  cost = N*X
  print(cost)
elif K < N:
  cost = K*X + (N-K)*Y
  print(cost)
# Judge status: Accepted
N = int(input())
ans = 0
for i in range(1, N + 1):
    if len(str(i)) % 2 == 1:
        ans += 1
print(ans)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
cnt=0
ans=0
mini=10000000000
for i in a:
    if i<0:
        cnt+=1
    p=abs(i)
    ans+=p
    if p<mini:
        mini=p
if cnt%2==1:
    ans-=mini*2
print(ans)
# Judge status: Wrong Answer
mod = 10**9+7
n,a,b = map(int, input().split())
ans = 0
c = 1
x = n
y = 1
if a!=n and b!=n: ans+=c
for i in range(1,-(-n//2)+1):
    c = c*x//y
    x-=1
    y+=1
    ans += c*2
    if i==a or n-i==a:
        ans -= c
    if i==b or n-i==b:
        ans -= c
    if i==n/2:
        ans -= c
    ans %= mod

print(ans)
# Judge status: Accepted
import numpy as np

N, M = map(int, input().split())
AC = np.zeros(N, dtype = int)
WA = np.zeros(N, dtype = int)

for i in range(M):
  p, s = input().split()

  if s == 'WA' and AC[int(p) - 1] == 0:
    WA[int(p) - 1] += 1
  else:
    AC[int(p) - 1] = 1

print(sum(AC), sum(AC * WA))
# Judge status: Accepted
a,b,c,x,y = map(int, input().split())
if (a+b <= c*2):
    print(a*x+b*y)
else:
    if (x>=y):
        print(min(y*c*2+(x-y)*a,x*c*2))
    else:
        print(min(x*c*2+(y-x)*b,y*c*2))
# Judge status: Wrong Answer
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

ans = (K * X) + ((N - K) * Y)

print (ans)
# Judge status: Wrong Answer
n = input()
n = int(n)
ans = 0.0

if n == 1:
    print(1)
elif n % 2 == 0:
    ans = n/2
    print(ans)
else:
    ans = (int(n/2)+1) / n
    print(ans)
# Judge status: Accepted
import sys
stdin = sys.stdin

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

import numpy as np

x = na()
for i, xi in enumerate(x):
    if xi==0:
        print(i+1)
# Judge status: Wrong Answer
h, a = map(int, input().split(' '))
print(h // a + 1)
# Judge status: Wrong Answer
N, M = map(int, input().split())

if (N == 1):
  print(max(M-2, 0))
elif (N == 2):
  print(0)
else:
  if (M == 1):
    print(N-1)
  elif (M == 2):
    print(0)
  else:
    print((N-2)*(M-2))
# Judge status: Accepted
S = input()
if S.count('A') == 3 or S.count('B') == 3:
    print('No')
else:
    print('Yes')
# Judge status: Accepted
huga = list(map(int, input().split()))
huga.sort()
if huga[0] == 5 and huga[1] == 5 and huga[2] == 7:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
import numpy as np

n, m = map(int, input().split())
from_1 = np.zeros(n+1, dtype=np.int)
to_n = np.zeros(n+1, dtype=np.int)
for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        from_1[b] = 1
    elif b == n:
        to_n[a] = 1

print('IMPOSSIBLE') if np.sum(from_1*to_n) == 0 else print('POSSIBLE')
# Judge status: Accepted
n,m = map(int,input().split())
a=list(map(int,input().split()))
sam =  sum(int(i) for i in a)
SAM = n-sam
if SAM >=0:
  print(SAM)
else:
  print(-1)
# Judge status: Accepted
n = int(input())
l = list(map(int,input().split()))

from itertools import accumulate
cum=list(accumulate(l))

tot=sum(l)
ans=2020202020*100000
for i in cum:
    ans=min(ans, abs(tot-i*2))
print(ans)
# Judge status: Wrong Answer
A, B = [int(x) for x in input().split(" ")]

if (A+B)%2 == 0:
  print((A+B)/2)
else:
  print("INPOSSIBLE")
# Judge status: Accepted
S = input()
if len(S) == 1:
    print('YES')
    exit()
if len(set(list(S))) == 1 or (len(set(list(S))) == 2 and len(S) != 2):
    print('NO')
    exit()
cnt = [S.count('a'),S.count('b'),S.count('c')]
if max(cnt)-min(cnt) <= 1:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
N = int(input())

k = 1
while k * 2 <= N:
    k *= 2

print(k)
# Judge status: Accepted
#20
import sys
s = int(input())
a = []
i = 2

while i >0:
    if s %2 == 0:
        a.append(s)
        s = int(s/2)
    else:
        a.append(s)
        s = 3*s+1
    for j in a:
        if s == j:
            print(i)
            sys.exit()
    i+=1
# Judge status: Wrong Answer
k , n = map(int, input().split())
arr = list(map(int, input().split()))

dist = 0

for i in range(len(arr)):
    if i is 0:
        if k - arr[i-1] > dist:
            dist = k - arr[i-1]
    
    if arr[i] - arr[i-1] > dist:
        dist = arr[i] - arr[i-1]

print(k - dist)
# Judge status: Accepted
n,m = map(int,input().split())
A = list(map(int,input().split()))
tmp = n-sum(A)

if tmp >= 0:
  print(tmp)
else:
  print(-1)
# Judge status: Wrong Answer
n,m=map(int,input().split())
l=list(map(int,input().split()))
print(-(-int(len(l)-m/m-1)))
# Judge status: Wrong Answer
import math
 
N = int(input())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))
 
a = 0
b = 0
 
numcheck = [1 for i in range(N)]
numcheck[P[0]-1] = 0
a = math.factorial(N-1)*(P[0]-1) 
for n in range(1,N):
  num = P[n]
  numcheck[num-1] = 0
# Judge status: Accepted
from heapq import*
(N, M), *t = [map(int, s.split()) for s in open(0)]
q, z = [], 0
v = [[] for _ in [None] * 10**5]
for a, b in t:
    v[a - 1] += b,
for i in v[:M]:
    for j in i:
        heappush(q, -j)
    if q:
        z += -heappop(q)
print(z)
# Judge status: Accepted
l = list(map(int, input().split()))
l.sort()
if l == [5,5,7]:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
def main():
    X, Y = map(int, input().split())

    if((4 * X) < Y):
        print("No")
    else:
        turuNum = (Y - 2 * X) / 2
        kameNum = X - turuNum

        if(turuNum.is_integer() and kameNum >= 0 and turuNum >= 0):
            print("Yes")
        else:
            print("No")

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
s = input()

N = len(s)
if s==s[::-1] and s[:(N-1)//2]==s[:(N-1)//2][::-1] \
                            and s[(N+3)//2:N]==s[(N+3)//2:N][::-1]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s = list(map(int,input().split()))
s.sort()
if s==[5,5,7]:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
k,n=map(int,input().split())
for i in range(k-1):
  print(n-k+i,end="")
print(n,end="")
for i in range(k-1):
  print(n+i+1,end="")
# Judge status: Wrong Answer
from collections import Counter
N, M = map(int, input().split())
R = []
for i in range(M):
  R += list(map(int, input().split()))
R = Counter(R)
K = sorted(R)
for k in K:
  print(R[k])
# Judge status: Accepted
S=input()
cnt=0
i=1
while i<len(S):
  if S[i]==S[i-1]:
    cnt+=1
    i+=2
  i+=1
print(len(S)-cnt)
# Judge status: Accepted
import sys

N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))

B = [-1 for _ in range(N)]
ans = []

for i in range(N, 0, -1):
    tmp_sum = 0
    tmp_i = 2 * i
    while N >= tmp_i :
        tmp_sum += B[tmp_i - 1]
        tmp_i += i

    # print(i, tmp_sum)
    if A[i-1] == tmp_sum % 2:
        B[i-1] = 0
    else:
        ans.append(i)
        B[i-1] = 1

print(len(ans))
if len(ans):
    print(" ".join(map(str, ans[::-1])))