peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
a, b, c = map(int, input().split())
d = (a % 2) + (b % 2) + (c % 2)
m = max(a, b, c)
s = a + b + c
ans1 = (3 * m - s) // 2
ans2 = (3 * (m + 1) - s) // 2
if d == 0 or d == 3:
    ans = ans1
elif d == 1:
    if m % 2 == 1:
        ans = ans1
    else:
        ans = ans2
else:
    if m % 2 == 0:
        ans = ans1
    else:
        ans = ans2
print(ans)
# Judge status: Accepted
n = int(input())
count = 0

for i in range(1, n+1):
    num = str(i)
    if len(num) %2 != 0:
        count += 1

print(count)
# Judge status: Accepted
S = input()
res = ""
for i in range(len(S)):
  res += "x"
print(res)
# Judge status: Wrong Answer
A,B=map(int,input().split())
if (A+B)%2==0:
    print (A+B/2)
else:
    print ('IMPOSSIBLE')
# Judge status: Accepted
s=str(input())
t=[]
t.append(s[0])
for i in range(1,len(s)):
  if s[i] in t:
    print("no")
    exit()
  t.append(s[i])

print("yes")
# Judge status: Wrong Answer
S = input()

S = sorted(S)

S_dict = {}
cnt = 0
for s in S:
  if s not in S_dict:
    S_dict[s] = 1

print(S_dict)

ALL = 'abcdefghijklmnopqrstuvwxyz'

answer= None
for c in ALL:
  if c not in S_dict:
    answer = c
    break

print(answer)
# Judge status: Wrong Answer
N, M = map(int,input().split())
ans = 0
for i in range(max(0,M//2-N-100), max(0, M//2-N+100)):
    ans = max(ans,min(N+i//2,(M-i)//2))
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())

a = list(map(int, input().split()))
done = [0]*n
stay = 1

for i in range(1, k+1):
    if done[stay-1] != 0:
        break
    done[stay-1] = i
    stay = a[stay-1]

nokori = k + 1 - i
if nokori != 1:
    loop = i - done[stay-1]
    for i in range(nokori%loop):
        stay = a[stay-1]

print(stay)
# Judge status: Wrong Answer
S=list(input())
A=[]
B=[]
a=0
b=0
for i in range(len(S)):
    if i%2==0:
        A.append("0")
    else:
        A.append("1")
for i in range(len(S)):
    if A[i]!=S[i]:
        a+=1
for j in range(len(S)):
    if i%2==0:
        B.append("1")
    else:
        B.append("0")
for j in range(len(S)):
    if B[j]!=S[j]:
        b+=1
print(min(a, b))
# Judge status: Accepted
a, b, c, d = map(int, input().split())
print(max(min(b, d) - max(a, c), 0))
# Judge status: Accepted
N = int(input())
A = [int(input()) for _ in range(N)]

d = {}
#key設定
for i in A:
    d[i]=0
#数字keyが偶数回出たら0,奇数回出たら1になるようにvalueを設定
for i in A:
    if d[i]==1:
        d[i]=0
    else:
        d[i]=1
    
print(sum(d.values()))
# Judge status: Accepted
s,t=input().split()
a,b=map(int,input().split())
if input()==s:
    print(str(a-1)+" "+str(b))
else:
    print(str(a)+" "+str(b-1))
# Judge status: Accepted
n,m=map(int,input().split())
if n==1 and m==1:
  ans=1
  print(ans)
  exit()

if min(n,m)==1:
  ans=max(n,m)-2
  print(ans)
  exit()
  
print((n-2)*(m-2))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
cnt = [0] * (n+1)
for x in a: cnt[x] += 1
s = 0
for x in cnt: s += x * (x-1) // 2

for x in a:
    ans = s
    if cnt[x] >= 2: ans -= cnt[x]-1
    print(ans)
# Judge status: Wrong Answer
if __name__ == '__main__':
    a, b = input().split(' ')
    print(a+b)
# Judge status: Accepted
A,B,N = map(int,input().split())
if B>N:
    print(int(A*N/B)-A*(int(N/B)))
else:
    print(int(A*(B-1)/B)-A*(int((B-1)/B)))
# Judge status: Wrong Answer
from collections import Counter
n = int(input())
s = list(input())
c = Counter(s)
ans = 1
for i in c.values():
    ans *= ((i+1) % 1000000007)
print(ans-1)
# Judge status: Accepted
S = input()
c = ''
L = []
i = 0
j = 3
min = 10**9
while j<=len(S):
    c = S[i:j]
    L.append(int(c))
    i += 1
    j += 1
for element in L:
    if abs(753-element) < min:
        min = abs(753-element)
print(min)
# Judge status: Accepted
n,*x=map(int,open(0).read().split())
y=sorted(x)[n//2-1:n//2+1]
for i in x:print(y[i<=y[0]])
# Judge status: Accepted
x=int(input())
if (x==1):
    print(0)
else:
    print(1)
# Judge status: Wrong Answer
data = [int(input()) for i in range(3)]
print((data[0]+data[1])*data[2]*0.5)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
count=0

while all(a%2==0 for a in A):
  A=[a//2 for a in A]
  count+=1

print(count)
# Judge status: Accepted
N = int(input())
power = 1
for i in range(1,N+1):
    power *= i
    if power >= 10**9 + 7:
        power %= 10**9 + 7
print(power % (10**9 + 7))
# Judge status: Wrong Answer
a=input()
n=len(a)

for i in range(1<<n):
    sum=0
    st=''
    for j in range(n):

        if i & (1 <<j):sum +=int(a[j]); st+= '+' + a[j] 
        else: st+= '-' + a[j]

    if sum==7:break

print(st[1:] + '=7')
# Judge status: Wrong Answer
apple = list(map(int, input().split("/")))
if apple[0] >= 2020:
    print("TBD")
elif apple[0] <= 2018:
    print("Hesise")
else:
    if apple[1] <= 4:
        print("Heise")
    elif apple[1] >= 5:
        print("TBD")
# Judge status: Wrong Answer
k, s = list(map(int, input().split()))

count = 0

for p in range(k+1):
    if p > s:
        break
    for q in range(k+1):
        if p + q < s:
            break
        for r in range(k+1):
            t = p + q + r
            if t == s:
                count += 1
                break

print(count)
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))
import collections
c = collections.Counter(A)

M = 0
N = 0
for x in c.items():
    if x[1] >= 4 and x[0] > M:
        M = x[0]
        N = x[0]
    elif x[1] >= 2 and x[0] > M:
        N = M
        M = x[0]
    elif x[1] >= 2 and x[0] > N:
        N = x[0]
 
print(M*N)
# Judge status: Accepted
s = input()
t = input()
s_list = list(s)
flg = False
for i in range(len(s)):
    s_list.insert(0,s_list[-1])
    del s_list[-1]
    if "".join(s_list) == t:
        print('Yes')
        flg = True
        break
        
if not flg:
    print('No')
# Judge status: Accepted
A, B = map(int,input().split())
if A<10 and B<10:
    print(A*B)
else:
    print(-1)
# Judge status: Accepted
def solve():
    S = input()

    # print(S)

    head = S.index("A")
    tail = S[::-1].index("Z")
    tail = len(S) - tail

    return S[head:tail]


if __name__ == '__main__':
    res = solve()
    print(len(res))
# Judge status: Wrong Answer
n = int(input())
ans = 1
x = 10 ** 18
a = list(map(int,input().split()))
for i in range(n):
    ans = ans * a[i]
    answer = ans 
    if (ans > x):
        print(-1)
    else:
        print(answer)
# Judge status: Accepted
from itertools import accumulate
import math
n, k = map(int, input().split())
a = list(map(int, input().split()))

c_sum = [0] * (n+1)
now = [0] * n

if k > 50:
    ans = [n] * n
    print(*ans)
    exit()

for i in range(k):
    c_sum = [0] * (n+1)
    for x, d in enumerate(a):
        s = max(0, x - d)
        c_sum[s] += 1
        e = min(n-1, x + d)
        c_sum[e+1] -= 1
    a = list(accumulate(c_sum))

print(*list(accumulate(c_sum))[:-1])
# Judge status: Accepted
from itertools import permutations
N=int(input())
P=list(map(int,input().split()))
Q=list(map(int,input().split()))

P="".join(map(str,P))
Q="".join(map(str,Q))
for i,v in enumerate(permutations(range(1,N+1))):
  v="".join(map(str,v))
  if P==v:
    a=i
  if Q==v:
    b=i
print(abs(a-b))
# Judge status: Wrong Answer
s,t=input().split()
print(s+t)
# Judge status: Accepted
A,B,N = map(int, input().split())

if B>N:
	print(int(A*N/B)-A*int(N/B))
else:
	print(int(A*(B-1)/B))
# Judge status: Accepted
N = int(input())
s_li = []
ans = "Yes"
for i in range(N):
    s = input()
    if i > 0:
        if s in s_li or s_li[i - 1][-1] != s[0]:
            ans = "No"
    s_li.append(s)

print(ans)
# Judge status: Wrong Answer
d, n = map(int, input().split())

print(int(100**d *n))
# Judge status: Accepted
N = input()

if N[0] == '7' or N[1] == '7' or N[2] == '7' :
	print ('Yes')

else :
	print ('No' )
# Judge status: Accepted
N, M = map(int, input().split())
sp = [list(map(int, input().split())) for i in range(N)]
cp = [list(map(int, input().split())) for i in range(M)]

def mah(p1, p2):
    return abs(p1[0] - p2[0]) + abs(p1[1] - p2[1])

sci = []

for i in range(N):
    mindis = 0
    minind = 0
    for j in range(M):
        m = mah(sp[i], cp[j])
        if j == 0 or mindis > m:
            mindis = m
            minind = j
    sci.append(minind+1)

print('\n'.join(map(str, sci)))
# Judge status: Accepted
n, x = map(int, input().split())
l = list(map(int, input().split()))

sum = 0
ans = 0

for i in range(n):
    if sum + l[ans] > x:
        break
    sum += l[ans]
    ans += 1

print(ans+1)
# Judge status: Accepted
N = int(input())

ans = 10**5
for a in range(0, N+1):
	cnt = 0
	t = 1
	for i in range(7):
		cnt += (a//t)%6
		t *= 6
	t = 1
	for i in range(6):
		cnt += ((N-a)//t)%9
		t *= 9
	ans = min(ans, cnt)
print(ans)
# Judge status: Accepted
n=int(input())
a=0
i=1
while a<n:
    a+=i
    i+=1
tmp=a-n
for j in range(1,i):
    if j!=tmp:
        print(j)
# Judge status: Wrong Answer
def factorization(n):
    arr = [1]
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            
            while temp%i==0:
                temp //= i
            arr.append(i)
    if len(arr)==1:
      arr.append(n)
    return arr 
A, B = map(int,input().split())
print(len(set(factorization(A))&set(factorization(B))))
# Judge status: Accepted
from sys import stdin
import sys
import math
from functools import reduce
import itertools

n = int(stdin.readline().rstrip())
p = [int(x) for x in stdin.readline().rstrip().split()]

m = n
count = 0
for i in range(n):
    m = min([m, p[i]])
    if m == p[i]: count = count + 1

print(count)
# Judge status: Accepted
import heapq
N,M = map(int,input().split())
jobs = [ [] for _ in range(M+1) ]
for _ in range(N):
  a,b = map(int,input().split())
  if a <= M:
    jobs[a].append(b)

pq = []
d = 1
res = 0
for _ in range(M-1, -1, -1):
  for b in jobs[d]:
    heapq.heappush(pq, -b)
  if pq:
    res += -heapq.heappop(pq)
  d += 1

print(res)
# Judge status: Wrong Answer
s=input()
if s=="SUN":
    print(7)
elif s=="SAT":
    print(1)
elif s=="FRI":
    print(2)
elif s=="THU":
    print(3)
elif s=="WED":
    print(4)
elif s=="THE":
    print(5)
elif s=="MON":
    print(6)
# Judge status: Accepted
a, b, c = map(int, input().split())

if b - a == c - b:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
def solve():
    A, B, C = map(int, input().split())
    if A == B and A != C:
        print('Yes')
    elif A == C and A != B:
        print('Yes')
    elif B == C and A != B:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    solve()
# Judge status: Wrong Answer
s = input()

f = True
if s[2] == s[3] and s[4] == s[5]:
    print('Yes')
else:
    print('NO')
# Judge status: Accepted
import math
def primes(n):
    l= []
    for i in range(2,math.floor(math.sqrt(n))):
        while n % i == 0:
            n = n//i
            l.append(i)
        if n == 1: 
            break
    
    if n > 1:
        l.append(n)
    return l

a,b=map(int,input().split())
sa=set(primes(a))
sb=set(primes(b))
sans=sa.intersection(sb)
print(len(sans)+1)
# Judge status: Accepted
from collections import Counter

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

kosu = dict(Counter(a))

ans = sum(a)

for i in range(q):
    b, c = map(int, input().split())
    if b in kosu:
        if c not in kosu:
            kosu[c] = 0
        ans += (c - b) * kosu[b]
        kosu[c] += kosu[b]
        kosu[b] = 0

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

s = list(input())

ans = 0

for i in range(n):
    x = s[:i+1]
    y = s[i:]
    ans = max(ans,len(set(x)&set(y)))

print(ans)
# Judge status: Accepted
a = input()
x = 0
y = 0
for t in range(0,len(a)):
    if t%2 == 0 and a[t] == "1":
        x = x+1
    if a[t] == "0" and t%2 == 1:
        x = x+1
        
for t in range(0,len(a)):
    if t%2 == 0 and a[t] == "0":
        y = y+1
    if  t%2 == 1 and a[t] == "1":
        y= y+1
        
print (min(y,x))
# Judge status: Wrong Answer
def main():
    n = int(input())

    count = n + 1

    for i in range(1,int(n**0.5)):
        if n % i == 0 and n // i + i < count:
            count = n // i + i

    print(count-2)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N, M = [int(x) for x in input().split()]

S = []
for i in range(N):
    S.append(None)

for i in range(M):
    s, c = [int(x) for x in input().split()]
    
    if S[s - 1] == None:
        S[s - 1] = c
    elif S[s - 1] == c:
        pass
    else:
        S[0] = 0
        break

if S[0] == 0 and N > 1:
    print(-1)
else:
    for s in S:
        if s == None:
            s = '0'
        print(s, end="")
print()
# Judge status: Accepted
n = int(input())
w = list(map(int, input().split()))
ans = 10**6

for i in range(n-1):
    ans = min(ans, abs(sum(w[:i+1]) - sum(w[i+1:])))

print(ans)
# Judge status: Accepted
from collections import defaultdict as dd
N,X,Y = map(int, input().split())
D = dd(int)
for i in range(1,N):
  for j in range(i+1,N+1):
    D[min(abs(i-j),abs(X-i)+abs(Y-j)+1,abs(Y-i)+abs(X-j)+1)] += 1 
for k in range(1,N):
  print (D[k])
# Judge status: Accepted
s, t = open(0).read().split()
n, m = len(s), len(t)
a = 2000
for i in range(n - m + 1):
    b = 0
    for j in range(m):
        b += s[i + j] != t[j]
    a = min(a, b)
print(a)
# Judge status: Accepted
n=int(input())
ans=0
for i in range(1,n):
  ans+=(n-1)//i
print(ans)
# Judge status: Accepted
N = int(input())
ans = 0
for a in range(1, N):
    ans += (N-1) // a
print(ans)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())

if (a+b+c) % 2 == 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import math

N = int(input())

if N % 2 == 0:
    ans = 0.5
else :
    ans = math.ceil(N / 2) / N

print(ans)
# Judge status: Accepted
def main():
    A, B, M = map(int, input().split())

    aryA = [int(v) for v in input().split()]
    aryB = [int(v) for v in input().split()]

    minPrice = min(aryA) + min(aryB)

    for _ in range(M):
        x, y, c = map(int, input().split())

        x -= 1
        y -= 1

        minPrice = min(minPrice, aryA[x] + aryB[y] - c)

    print(minPrice)


main()
# Judge status: Accepted
n = int(input())

mod = 10**9+7
ans = 1

for i in range(n):
    ans *= (i+1)
    ans %= mod



print(ans)
# Judge status: Accepted
import collections
n = int(input())
a = [int(input()) for _ in range(n)]
c = list(collections.Counter(a).values())
print(sum([c_i % 2 for c_i in c]))
# Judge status: Wrong Answer
from math import *
n,d=map(int,input().split())
k=d*d
ans=0
for i in range(n):
    x,y=map(int,input().split())
    x1=x**2
    y1=y**2
    m=x1+y1
    if m>=k:
        ans=ans+1
print(ans)
# Judge status: Wrong Answer
import sys; sys.setrecursionlimit(2147483647); input = sys.stdin.readline
from math import floor, ceil, sqrt, factorial, log
from collections import Counter, defaultdict, deque
from operator import itemgetter
INF = float('inf'); MOD = 10**9+7
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(MI())
def LIR(n): return [LI() for i in range(n)]
def IS(): return input().rstrip()

def main():
    S = IS()
    if 'hi' in S:
        print('Yes')
    else: print('No')

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n,m=map(int,input().split())
n,m=min(n,m),max(n,m)
if n==1:
    print(max(0,m-2))
    exit()
else:
    print(max(0,(n-2)*(m-2)))
# Judge status: Wrong Answer
n, m, k = map(int, input().split())
for i in range(n + 1):
    for j in range(m + 1):
        black = n * (m - j) + (n - i) * m
        if black == k:
            print("Yes")
            exit()
print("No")
# Judge status: Accepted

def main():
    n = int(input())
    pos = 0
    count = 0
    while pos < n:
        count += 1
        pos += count
    print(count)


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

if a+b+c>=22:
    print("bust")
else:
    print("win")
# Judge status: Wrong Answer
X,Y,Z = map(int, input().split())
X -= 2 * Z
X -= Y
ans = 0
if 0 < X:
    ans = 1 + X // (Y + Z)

print(ans)
# Judge status: Accepted
S = input()
num = len(S)//2
if num % 2 == 0:
    for i in range(num):
        if S[i] == S[-i-1]:
            num -= 1
else:
    for i in range(num):
        if S[i] == S[-i-1]:
            num -= 1
print(num)
# Judge status: Accepted
from itertools import combinations
n = int(input())
a = [int(i) for i in input().split()]
a.sort()

ai = a[-1]
aj = -1
for i in range(n-1):
    if abs(a[i] - ai/2) <= abs(aj - ai/2):
        aj = a[i]
print(ai, aj)
# Judge status: Accepted
a,b,c,k=map(int,input().split())
'''l=[]
for _ in range(a):
    l.append(1)
for _ in range(b):
    l.append(0)
for _ in range(c):
    l.append(-1)
print(sum(l[:k]))'''
su=0
if a>=k:
    print(k)
else:
    su=su+a
    tem=k-a
    if b>=tem:
        print(su)
    else:
        tem1=tem-b
        print(su-tem1)
# Judge status: Wrong Answer
n, m = map(int, input().split())

s = [0] * n
s[0] = 1
b = [1] * n
for i in range(m):
    x, y = map(int, input().split())
    b[x-1] -= 1
    b[y-1] += 1

    s[x-1] = int(b[x-1] != 0)
    s[y-1] = s[x-1]

print(sum(s))
# Judge status: Accepted
a, b, c = map(int, input().split())

total = a + b

if total >= c:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import sys

k=int(input())
mae=0

for i in range(10**6+1):
  now=(10*mae+7)
  if now%k==0:
    print(i+1)
    sys.exit()
  mae=now%k

print(-1)
# Judge status: Wrong Answer
n,k = map(int,input().split())
h= list(map(int,input().split()))
sorted(h)
print(sum(h[:-k+1]))
# Judge status: Wrong Answer
a = int(input())
b = int(input())
for i in (1,4):
  if i not in [1,2,3]:
    print(i)
# Judge status: Accepted
string=input()
print("Yes" if string[2]==string[3] and string[4]==string[5] else "No")
# Judge status: Accepted
n,m=map(int,input().split())
edg1=[0]*(n+1)
edgn=[0]*(n+1)
for i in range(m):
    a,b=map(int,input().split())
    if a==1:
        edg1[b]=1
    if b==n:
        edgn[a]=1

f=1
for i in range(2,n+1):
    if edg1[i]==1 and edgn[i]==1:
        f=0
print("POSSIBLE" if f==0 else "IMPOSSIBLE")
# Judge status: Accepted
x = int(input())

for a in range(10**3):
  for b in range(10**3):
    frag = False
    if a ** 5 - b ** 5 == x:
      print(a,b)
      frag = True
      break
    elif (-a) ** 5 - b ** 5 == x:
      print(-a,b)
      frag = True
      break
      
    elif a ** 5 - (-b) ** 5 == x:
      print(a,-b)
      frag = True
      break
      
    elif (-a) ** 5 - (-b) ** 5 == x:
      print(-a,-b)
      frag = True
      break
  if frag == True:
      break
# Judge status: Wrong Answer
N = int(input())
An = list(map(int,input().split()))
Sum = 0
Sum += 2**N
for i in An:
	Sum+=2**i
# Judge status: Wrong Answer
import sys

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

for i in range(1,N-1):
    if not(H[i-1] <= H[i] <= H[i+1]):
        tmp = H[i] - 1
        if not(H[i-1] <= tmp <= H[i+1]):
            print('No')
            sys.exit()
        H[i] = tmp
    H[i] -= 1
print('Yes')
# Judge status: Accepted
n = int(input())
b = list(map(int, input().split()))

a = [b[0]]
for num, i in enumerate(b[1:]):
  a.append(min(i, b[num]))
a.append(b[-1])
print(sum(a))
# Judge status: Accepted
s = input()
t = input()
ans = []
a = ''
for i in range(len(s)-len(t)+1):
    flag = True
    a = s[:i]
    for j in range(len(t)):
        if s[i+j] == t[j] or s[i+j] == '?':
            a += t[j]
        else:
            flag = False
            break
    a += s[i+j+1:]
    if flag:
        ans.append(a.replace('?','a'))
if ans:
    ans.sort()
    print(ans[0])
else:
    print('UNRESTORABLE')
# Judge status: Accepted
#!/usr/bin/python
# -*- coding: UTF-8 -*-

import sys


def get_ints():
    return map(int, sys.stdin.readline().strip().split())


def main():
    a, b, c, d = get_ints()

    print(max(a*c, a*d, b*c, b*d))


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
test_input = str(input())
if test_input.count("A") == 3 or test_input.count("B") == 3:
    print ("FALSE")
else:
    print("TRUE")
# Judge status: Wrong Answer
n = int(input())
a_list = list(map(int,input().split()))
n_len = len(a_list)
left = 0
count = 0
for i in range(1,n+1):
    for j in range(left,n):
        if a_list[j] == i:
            left = j+1
            break
        count += 1
    if left > n_len-1:
        print(count)
        break
else:
    print(-1)
# Judge status: Wrong Answer
x,y ,z= map(int,input().split())
ans=x/z
print(ans)
if ans>=y:
	print('Yes')
else:
	print('No')
# Judge status: Accepted
s = input()
print("Yes" if len(set(s))==3 else "No")
# Judge status: Accepted
n,m=map(int,input().split())
A=[]
B=[]
for i in range(m):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)
for j in range(n):
    print(A.count(j+1)+B.count(j+1))
# Judge status: Wrong Answer
import sys

n,k,q = map(int,input().split())

if k > q:
    for _ in range(n):
        print('Yes')
        sys.exit()

A = []
for _ in range(q):
    a = int(input())
    A.append(a)

ans = [0]*n

from collections import Counter
cnt = Counter(A)
for key,v in cnt.items():
    if v >= q-k+1:
        ans[key-1] = 1

for i in range(n):
    if ans[i] == 0:
        print('No')
    else:
        print('Yes')
# Judge status: Wrong Answer
h, a = map(int, input().split())
print((h+a-1)/a)
# Judge status: Accepted
S=str(input())
print('2018/'+S[5:10])
# Judge status: Accepted
N = int(input())

def make_divisors(n: int):
    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)
    return divisors

ans = 0
for i in range(1, N+1, 2):
    if len(make_divisors(i)) == 8:
        ans += 1
print(ans)
# Judge status: Accepted
'''
Created on 2020/09/15

@author: harurun
'''
import sys
pin=sys.stdin.readline

N=int(pin())
dp=[[0]*3 for _ in [0]*N]

dp[0][0],dp[0][1],dp[0][2]=map(int,pin().split())
for i in range(1,N):
  a,b,c=map(int,pin().split())
  dp[i][0]=max(dp[i-1][1]+a,dp[i-1][2]+a)
  dp[i][1]=max(dp[i-1][0]+b,dp[i-1][2]+b)
  dp[i][2]=max(dp[i-1][0]+c,dp[i-1][1]+c)

print(max(dp[N-1]))
#解説AC
# Judge status: Accepted
from fractions import gcd

n = int(input())
s = list(map(int, input().split()))
def ngcd(a):
    y = a[0]
    for i in range(1, len(a)):
        y = y * a[i] // gcd(y, a[i])
    return y
g = ngcd(s)
ans = 0
for i in range(n):
    ans += g // s[i]
print(ans%1000000007)
# Judge status: Wrong Answer
s=input()
for e in s:
  if e=="7":
    print("YES")
    break
else:
  print("NO")
# Judge status: Accepted
n = int(input())
l = [int(i) for i in input().split()]

val = float("inf")
for i in range(-100,101):
	new = 0
	for j in l:
		new += (i-j)**2	
	val = min(val,new)		
print(val)
# Judge status: Accepted
n,m,x = map(int,input().split())
a = [list(map(int,input().split())) for i in range(n)]
import numpy as np

b = np.array(a)
total = []
for i in range(2**n):
    eff = np.array([0 for i in range(m)])
    money=0
    for j in range(n):
        if ((i >>j ) & 1):
            eff += b[j,1:]
            money+= b[j,0]
            if len(eff[eff>=x])==m:
                total.append(money)                
if len(total)==0:
    print(-1)
else:
    print(min(total))
# Judge status: Wrong Answer
N = int(input())

for i in range(1,10):
  if N%i==0:
    continue
  if len(str(int(N/i)))==1:
    print('Yes')
    break
else:
  print('No')
# Judge status: Accepted
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
ac = Counter(A)
ans = 0
for i in range(max(A)+1):
    now = 0
    if i-1 in ac:
        now += ac[i-1]
    if i in ac:
        now += ac[i]
    if i+1 in ac:
        now += ac[i+1]
    ans = max(ans,now)
print(ans)
# Judge status: Accepted
from collections import Counter

n = int(input())
s = input()
c = Counter(s)
d = {}

for k, v in c.items():
    d[k] = v

key = set(c.keys())
for i in range(n-1):    
    s = input()
    c = Counter(s)
    key = key.intersection(set(c.keys()))
    for k in key:
        d[k] = min(d[k], c[k])

ans = ''
for k, v in sorted(d.items(), key=lambda x: x[0]):
	if k in key:
	    ans += k*v
    
print(ans)
# Judge status: Wrong Answer
def main():
  x = 0
  n = int(input())
  a = list(map(int,(input().split())))
  for i in range(n):
#    print(i)
    if a[i:i+1] < a[i+1:i+2]:
#      print(a[i:i+1],a[i+1:i+2])
      a1 = a[i:i+1][0]
      a2 = a[i+1:i+2][0]
      x +=(a2-a1)
  print(x)
  
if __name__ == '__main__':
  main()