peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
buka=[0]*n
for i in a:
  buka[i-1]=buka[i-1]+1
for i in buka:
  print(i)
# Judge status: Wrong Answer
N = int(input())
AB = [list(map(int,input().split())) for _ in range(N)]
AB.reverse()
count = 0

for a,b in AB:
  if b == 1:
    continue
  else:
    num_a = a+count
    count += (b-num_a%b)

print(count)
# Judge status: Accepted
x = int(input())
tmp = 0

if x == 2:
  print(2)
  exit()
for i in range(x,10**111):
  for j in range(2,(i//2)+2):
    tmp += 1
    if i%j == 0:
      tmp = 0
      break
    elif tmp == (i//2):
      print(i)
      exit()
# Judge status: Accepted
N,K=list(map(int, input().split()))
if N%K==0:
  print(0)
else:
  print(1)
# Judge status: Wrong Answer
a=int(input())
b=list(input().split())
c=sorted(b)
ans=0
for i in range (a-1):
	if c[i]==c[i+1]:
		print("NO")
		break
	else:
		print("YES")
		break
# Judge status: Wrong Answer
import os
os.read(0, 10**8).split()
# Judge status: Accepted
nn = '0' + input()
ans = 0
dp = [[0 for i in range(2)] for j in range(len(nn))]
dp[0][1] = 1

for i,c in enumerate(nn[1:]):
    cc = int(c)
    zero = dp[i][0] + cc
    one = dp[i][1] + 10 - cc
    dp[i+1][0] = min(zero, one)
    dp[i+1][1] = min(zero + 1, one - (1 if i < len(nn) - 2 else 0))
print(min(dp[len(nn)-1]))
# print(dp)
# Judge status: Accepted
N=int(input())
L=sorted(list(map(int, input().split())))
print("Yes" if L[-1]<sum(L[:-1]) else "No")
# Judge status: Wrong Answer
s = int(input())
print(s/2 * (s+1)/2)
# Judge status: Wrong Answer
s = int(input())
if s<3:
  ans = 0
else:
  ans = 1
  rem = s%3
  l = range(s//3, 1, -1)
  for part in l:
    ans += part**rem
    rem += 3
print(ans % (10**9 + 7))
# Judge status: Wrong Answer
N, M = map(int,input().split())

A = list(map(int,input().split()))
n = 1

while (len(A) > 1) and (n<N ):
    K = list(map(int,input().split()))
    n +=1
    for i in A[1:]:
        if i not in K[1:]:
            A.remove(i)

print(len(A)-1)
# Judge status: Wrong Answer
import numpy as np
"""
x,y,a,b,c=[int(x) for x in input().split()]
p=[int(x) for x in input().split()]
q=[int(x) for x in input().split()]
r=[int(x) for x in input().split()]
"""

x,y,a,b,c=[1,2,2,2,1]
p=[2,4]
q=[5,1]
r=[3]

p=list(np.sort(p)[::-1][0:x])
q=list(np.sort(q)[::-1][0:y])

select=np.sort(p+q+r)[::-1][0:x+y]
print(sum(select))
# Judge status: Accepted
s=int(input())
nums=[]
now=s
cnt=0
nums.append(now)
while cnt<1000100:
        cnt+=1
        if now%2==0:
                now=now//2
        else:
                now=(now*3+1)
        if now in nums:
                break
        nums.append(now)
print(cnt+1)
# Judge status: Accepted
# -*- coding: utf-8 -*-

a, b = [int(i) for i in input().split()]

if (a*b%2 == 0):
    print("Even")
else:
    print("Odd")
# Judge status: Accepted
N=int(input())
p=list(map(int,input().split()))
ANS=0
ans=p[0]-p[1]
for i in range(2,N):
    if (p[i-1]-p[i])*ans>=0:
        ANS+=1
    ans=(p[i-1]-p[i])//abs(p[i-1]-p[i])
print(ANS)
# Judge status: Wrong Answer
D, N = map(int, input().split())
print((100 ** D) * N)
# Judge status: Accepted
a, b, c = map(int, input().split())

if a+b+c == 17 and (5 in [a,b,c] and 7 in [a,b,c]):
    print("YES")
else:
    print("NO")
# Judge status: Accepted
a, b, c, d = map(int, input().split())

lower = max(a, c)
upper = min(b, d)

if upper >= lower:
    print(upper - lower)
else:
    print(0)
# Judge status: Accepted
N = int(input())

a = list(map(int,input().split()))
a.sort(reverse = True)
Alice = []
Bob = []
for i in range(N):
    if i%2 ==0:
        Alice.append(a[i])
    else:
        Bob.append(a[i])
print(sum(Alice) - sum(Bob))
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
 
ans = 0
for i in range(n):
    left = min(A[i], B[i])
    B[i] -= left
    ans += left
    right = min(A[i + 1], B[i])
    A[i + 1] -= right
    ans += right
 
print(ans)
# Judge status: Accepted
n, p = map(int, input().split())
A = list(map(int, input().split()))

check = all(a%2 == 0 for a in A)
ans = 0
if check and p == 0:
  ans = 1 << n
if not check:
  ans = 1 << (n-1)
print(ans)
# Judge status: Accepted
x,y = map(int,input().split())
li = list(map(int, input().split()))

li.sort()
ans=0
for i in range(y):
    ans += li[i]
print(ans)
# Judge status: Accepted
S = input()

ans = 1000

for i in range(len(S)-2):
  if abs(int(S[i:(i+3)]) - 753) < ans:
    ans = abs(int(S[i:(i+3)]) - 753)
    
print(ans)
# Judge status: Accepted
n = int(input())
a_list = list(map(int,input().split()))
sum_a = sum(a_list)

sum = 0
for i in range(n):
  sum += a_list[i] * (sum_a-a_list[i])
  sum = sum%(10**9+7)
  sum_a -= a_list[i]
print(sum)
# Judge status: Accepted
D, N = map(int, input().split())

ans = N * 100 ** D

if N == 100:
    ans += 100 ** D

print(ans)
# Judge status: Accepted
from collections import Counter
N = int(input())
S = input()
MOD = 10**9+7
c = Counter(S)
ans = 1
for k in c.keys():
  ans *= (c[k]+1)
  ans %= MOD
print(ans-1)
# Judge status: Wrong Answer
S=input()
x=int(S[:2])
y=int(S[2:])
if x<=12:
    if y<=12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if y<=12:
        print("YYMM")
    else:
        print("NA")
# Judge status: Wrong Answer
input = input()
nums = input.split(" ")
for index, num in enumerate(nums):
    if int(num)==0:
        print(index)
# Judge status: Wrong Answer
N, m = map(int, input().split())
ans = m*100**N
# Judge status: Accepted
N,X,Y=map(int,input().split())
answers=[0]*(N-1)
for i in range(1,N+1):
    numbers=[a for a in range(1,N+1) if a!=i]
    for j in numbers:
        answer=min(abs(i-j),abs(X-i)+1+abs(j-Y),abs(i-Y)+1+abs(j-X))
        answers[answer-1]+=1
for a in answers:
    print(a//2)
# Judge status: Accepted
import itertools
import numpy as np
def main():

    n,m,x = tuple([int(t)for t in input().split()])

    a = [np.array([int(t)for t in input().split()])for _ in [0]*n]
    candidate = []
    for i in range(n):
        for data in itertools.combinations(a,i+1):
            data = sum(data)
            if np.all(data[1:]>=x):
                candidate.append(data[0])
    if len(candidate)==0:
        print(-1)
    else:
        print(min(candidate))


if __name__ == "__main__":
    main()
# Judge status: Accepted
a=input()
if a == '1':
  print('0')
elif a == '0':
  print('1')
# Judge status: Wrong Answer

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

MAX = 10 ** 5 + 10
dp = [-1] * MAX
dp[0] = 1000
for i in range(N):
    for j in range(1, MAX):
        dp[j] = max(dp[j], dp[j - 1] - X[i])

    for j in reversed(range(MAX - 1)):
        if dp[j + 1] >= 0:
            dp[j] = max(dp[j], dp[j + 1] + X[i])

print(max(dp))
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
res = 0
for i in range(n):
    t = min(a[i], b[i])
    a[i] -= t
    b[i] -= t
    res += t
    d = min(a[i+1], b[i])
    a[i+1] -= t
    b[i] -= t
    res += t
print(res)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
print('Yes' if a == c or b==c or a+b==c else 'No')
# Judge status: Accepted
N, K = list(map(int, input().split()))
K -= 1
A = list(map(lambda x: int(x) - 1, input().split()))
seen = [None]*N
seen_set = set()
now = 0
for i in range(N):
    seen[i] = now
    seen_set.add(now)
    to = A[now]
    now = to
    if now in seen_set:
        seen[i+1] = now
        loop_s = seen.index(now)
        loop_end = i + 1
        size = loop_end - loop_s
        break
if K <= loop_s:
    print(seen[K+1] + 1)
else:
    K -= loop_s
    print(seen[loop_s + 1 + K % size] + 1)
# Judge status: Wrong Answer
# D - Handstand 2
N = int(input())
count = 0
tmp = 0
DP = []

if N < 10:
    print(N)
    exit()
else:
    n = str(N)
    for i in range(9, N + 1):
        I = str(i)
        for j in range(int(I[-1]),N+1,10):
            J = str(j)
            if J[-1] == I[0] and J[0] == I[-1]:
                count += 1
    print(count)
# Judge status: Wrong Answer
A, B, N = map(int, input().split())
La =list(map(int, input().split())) 
Lb =list(map(int, input().split()))
ans = 10**10
for i in range (N):
  W = list(map(int, input().split())) 
  x = W[0]-1
  y = W[1]-1
  c = W[2]
  price = La[x] + Lb[y] -c
  if price < ans:
    ans = price
print(ans)
# Judge status: Accepted
a = int(input())
s = input() if a >= 3200 else 'red'
print(s)
# Judge status: Accepted
N, K = map(int, input().split())   
A = list(map(int, input().split()))

for i in range(K, N):
    prev = A[i-K]
    new = A[i]
    if prev < new:  
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
n = int(input())
if 360%n:
    print(360//(360%n))
else:
    print(360//n)
# Judge status: Accepted
a = input()
if a in 'aeiou':
  print('vowel')
else:
  print('consonant')
# Judge status: Accepted
def solve():
    S,T = input().split()
    A,B = [int(i) for i in input().split()]
    U = input()

    if U == S:
        print(A-1, B)
    else:
        print(A, B-1)

if __name__ == "__main__":
    solve()
# Judge status: Accepted
N=int(input())

if [4*x+7*y for y in range(101) for x in range(101)].count(N):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
# -*- coding: <encoding name> -*-

a, b =  map(int, input().split())
print((a + b)% 24)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())

print(min(c,a//b))
# Judge status: Wrong Answer
A,B=map(int,input().split())
print(A*B) if(A < 1 or A > 9 or B < 1 or B > 9) else print(-1)
# Judge status: Accepted
n = int(input())
d_l = list(map(int,input().split()))

count_dict = {}
for i in range(n):
    count_dict[i] = 0
for val in d_l:
    count_dict[val] += 1

if d_l[0] != 0 or count_dict[0] != 1:
    ans = 0
else:
    ans = 1

for i in range(1,n):
    ans = (ans*(count_dict[i-1]**count_dict[i])) %998244353
    if ans == 0:
        break

print(ans)
# Judge status: Wrong Answer
from collections import Counter

n = int(input())
A = [a-i-1 for i, a in enumerate(map(int, input().split()))]
x = Counter(A)
target = x.most_common(1)[0][0]

ans = sum([abs(a-target) for a in A])

print(ans)
# Judge status: Accepted
def main():
    a, b, c = map(int, input().split())
    if a == b and b == c:
        print(-1 if a % 2 == 0 else 0)
        return
    cnt = 0
    for i in range(10 ** 9):
        if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
            break
        a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2
        cnt += 1
    print(cnt)


if __name__ == '__main__':
    main()
# Judge status: Accepted
N,M = map(int,input().split())
A = list(map(int,input().split()))
if N >= sum(A):
  print(N-sum(A))
else:
  print(-1)
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
a = [int(readline()) for i in range(n)][::-1]
ans = 0
for i in range(n - 1):
    ans += a[i] // 2
    if a[i] % 2 == 1 and a[i + 1] != 0:
        a[i + 1] -= 1
        ans += 1
ans += a[-1] // 2
print(ans)
# Judge status: Accepted
h,n=map(int,input().split())
x=map(int,input().split())

sum=0
for i in x:
  sum=sum+i

if sum<h:
  print("No")
else:
  print("Yes")
# Judge status: Accepted
n,m = map(int, input().split())
ans = 0

if m >= 2 and n > 0:
  ans += min(n, m // 2)
  m -= 2*ans

if m > 0:
  ans += m // 4
print(ans)
# Judge status: Accepted
from math import ceil
x = int(input())
q, mod = divmod(x, 11)
print(q * 2 + ceil(mod / 6))
# Judge status: Accepted
A, B, C, D = [int(i) for i in input().split()]
 
while A or C > 0:
  C -= B
  if C<=0:
    print('Yes')
    break
  A -= D
  if A<= 0:
    print('No')
    break
# Judge status: Wrong Answer
a,b,c = map(int, input().split())
k = int(input())

ans = "No"
for _ in range(k+1):
    if a < b and b < c:
        ans = "Yes"
        break
    elif b < a:
        b *= 2
    elif c < b:
        c *= 2
print(ans)
# Judge status: Accepted
import math
A,B,C = map(int, input().split())

#A-B Partern
base1 = A*B
part1_a = math.ceil(C/2)
part1_b = C-part1_a 
ans1 = abs((base1*part1_a)-(base1*part1_b))

#A-C Partern
base2 = A*C
part2_a = math.ceil(B/2)
part2_b = B - part2_a 
ans2 = abs((base2*part2_a)-(base2*part2_b))

#B-C Partern
base3 = B*C
part3_a = math.ceil(A/2)
part3_b = A - part3_a 
ans3 = abs((base3*part3_a)-(base3*part3_b))

print(min(ans1,ans2,ans3))
# Judge status: Wrong Answer
data = input().split(" ")

N = int(data[0])
M = int(data[1])

ans = N*(N-1)/2
ans += M*(M-1)/2

print(ans)
# Judge status: Accepted
import math
n=int(input());a=[int(input()) for _ in range(n)];r=a[0]
for i in a:
  r=r*i//math.gcd(r,i)
print(r)
# Judge status: Accepted
D, N = map(int, input().split())
print((100 ** D) * 101 if N == 100 else (100 ** D) * N)
# Judge status: Accepted
import sys
from functools import reduce

def main(n, k, p):
    """ main
    """
    p.sort()
    return sum(p[0:k])

if __name__ == "__main__":
    N, K = map(int, sys.stdin.readline().split(" "))
    P = list(map(int, sys.stdin.readline().split(" ")))

    print(main(N, K, P))
# Judge status: Accepted
wrong = [input() for _ in range(2)]

if "1" not in wrong:
  print("1")
elif "2" not in wrong:
  print("2")
elif "3" not in wrong:
  print("3")
# Judge status: Accepted
N = int(input())
ans = 0

for n in range(1,N+1):
  if n%3 != 0 and n%5 != 0:
    ans+=n
    
print(ans)
# Judge status: Accepted
'''
Created on 2020/08/27

@author: harurun
'''
def main():
  import math
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  a,b,x=map(int,pin().split())
  if 2*x>a*a*b:
    print(math.degrees(math.atan((2*b*a*a-2*x)/(a*a*a))))
  else:
    print(math.degrees(math.atan(a*b*b/(2*x))))
  return 

main()
# Judge status: Accepted
s = input()
print('Yes' if s[2] == s[3] and s[4] == s[5] else 'No')
# Judge status: Accepted
a, b, c = input().split()
set_in = {a, b, c}
if len(set_in) == 2:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
s=input()
print("Yes"if s[0]!=s[1]!=s[2] else "No")
# Judge status: Accepted
A, B, C = map(int, input().split())
print(C, A, B)
# Judge status: Accepted
def p_a():
    k, x = map(int, input().split())
    print("Yes" if 500 * k >= x else "No")
    
p_a()
# Judge status: Accepted
N,X,Y = map(int, input().split())
numbers = [0 for i in range(N-1)]
for i in range(N-1):
    for j in range(i+1,N):
        p = i+1
        q = j+1
        k = min(abs(X-p)+1+abs(Y-q),q-p)
        
        numbers[k-1] += 1


for i in range(N-1):
    print(numbers[i])
# Judge status: Wrong Answer
n,a,b = map(int,input().split())
mod = 10**9 + 7
aue,bue = 1,1
for i in range(a):
    aue = aue * (n-i) % mod
for i in range(b):
    bue = bue * (n-i) % mod
asita,bsita = 1,1
for i in range(1,a+1):
    asita = asita*i %mod
for i in range(1,b+1):
    bsita = bsita*i %mod
at = aue * pow(asita,mod-2,mod)
bt = bue * pow(bsita,mod-2,mod)

print(at)
ans = (pow(2,n,mod) - 1 -at -bt)%mod
print(ans)
# Judge status: Wrong Answer
n = int(input())
s = input()
c = 0
ar = s.split(' ')
for i in range(0, n):
  t = 0
  for j in range(0, i):
    if int(ar[i]) <= int(ar[j]):
    	t += 1
  if t > 0:
    c += 1
print(c)
# Judge status: Accepted
import sys, math
from collections import defaultdict
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)

N = ri()
A = []
for i in range(N):
	A.append(ri())

import collections, bisect
queue = collections.deque()

queue.appendleft(A[0])
for i in range(1, N):
	idx = bisect.bisect_left(queue, A[i])
	if idx == 0:
		queue.appendleft(A[i])
	else:
		queue[idx-1] = A[i]
print(len(queue))
# Judge status: Accepted
m=int(input())
N=input()
cnt=N.count('R')*N.count('G')*N.count('B')
#print(cnt)
for i in range(m-2):
  #print(i,'*',int((m+i)/2))
  for j in range(i+1,int((m+i-1)/2)+1):
    k=2*j-i
    #print(i,j,k)
    if N[k] != N[j] and N[j] != N[i] and N[i] != N[k]:
      #print(i,j,k)
      cnt-=1
print(cnt)
# Judge status: Accepted
import fractions
a,b = map(int, input().split())

ans = (a * b) // fractions.gcd(a, b)
print(ans)
# Judge status: Accepted
k=int(input())
t=7
for i in range(k):
    if t%k==0:
        print(i+1)
        break
    else:
        t=(10*t+7)%k
else:
    print(-1)
# Judge status: Accepted
n = int(input())
d = [int(i) for i in input().split()]
m = max(d)
cnt = [0]*(m+1)
ans = 1
flag = True
mod = 998244353

if d[0] == 0:
    cnt[0] += 1
else:
    flag = False

for i in range(1,n):
    if d[i] == 0:
        flag == False
        break
    else:
        cnt[d[i]] += 1

for i in range(1,m+1):
    ans *= cnt[i-1]**cnt[i]
    ans %= mod

if flag == False:
    ans = 0

print(ans)
# Judge status: Accepted
def main():
    N = int(input())

    if(N > 1):
        if(N % 2 == 0):
            odd_cnt = N // 2
        if(N % 2 == 1):
            odd_cnt = N // 2 + 1

        print(odd_cnt / N)
    else:
        print(N)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
n, m = map(int, input().split())
A, B = [], []
ans = 'IMPOSSIBLE'
for i in range(m):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
now = 1
result = n in B
if now == n:
    print('POSSIBLE')
    exit()
elif result == False:
    print(ans)
    exit()

else:
    be = B.index(n)
    before = A[be]
    for i in range(m):
        if B[i] == before:
            if A[i] == now:
                ans = 'POSSIBLE'
                break
print(ans)
# Judge status: Accepted
x, y = map(int, input().split())
cnt = 0
diff = abs(x) - abs(y)
if diff == 0:
    if x * y < 0:
        cnt += 1
elif diff > 0:
    cnt += diff
    if x > 0:
        cnt += 1
    if y > 0:
        cnt += 1
else:
    cnt += -diff
    if x < 0:
        cnt += 1
    if y < 0:
        cnt += 1
print(cnt)
# Judge status: Wrong Answer
n = int(input())
csf = [list(map(int,input().split())) for i in range(n-1)]

import math
for i in range(n):
    t = 0
    for j in range(i,n-1):
        if t < csf[j][1]:
            t = csf[j][1]
        elif t % csf[j][2] == 0:
            pass
        else:
            t = math.ceil(t/csf[j][2])
        t = t + csf[j][0]
    print(t)
# Judge status: Wrong Answer
K, N = map(int, input().split())
A = sorted(map(int, input().split()))
max_dis = abs(A[0]-A[-1])%K
pre = A[0]
for a in A[1:]:
    max_dis = max(max_dis, abs(a-pre))
    pre = a
ans = K - max_dis
print(ans)
# Judge status: Accepted
n,k = input().split()
N = int(n)
K = int(k)
p = [int(i) for i in input().split()]
p.sort()
ans = 0
for i in range (K):
    ans = ans + p[i]
print(ans)
# Judge status: Accepted
N = int(input())
V = list(map(int, input().split()))
V.sort()
res = 0.5 * (V[0] + V[1])
for i in range(2, N):
    res = 0.5 * (res + V[i])
print(res)
# Judge status: Accepted
X,Y=map(int,input().split())

print(int(X+Y/2))
# Judge status: Wrong Answer
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7


a, b = rm()
if a > 0:
    print('Positive')
elif a <= 0 <= b:
    print('Zero')
elif b-a & 1:
    print('Negative')
else:
    print('Positive')
# Judge status: Accepted
n,m = map(int,input().split())
city = [[0] for _ in range(n)]
for i in range(m):
    a,b = map(int,input().split())
    city[a-1].append(b)
    city[b-1].append(a)
for i in city:
    print(len(i)-1)
# Judge status: Wrong Answer
q,h,s,d=map(int,input().split())
n=int(input())
 
l=min(q*n*8,h*n*4,s*n*2,d*n)
if l != d*n:
    print(int(l/2))
else:
    m=min(q*4,h*2,s)
    print(int((d*(n-1)/2))+m if n%2==1 else int(l/2))
# Judge status: Wrong Answer
S = list(input())
N = int(input())

'''
ordの位置
#z = 122
#a = 97
左の文字からNで'a'に出来るかを確認
aに出来るならaにして使った分をNから引く
繰り返して行き一番最後にあまりをすべて使う'''
  
for i, s in enumerate(S):
  if ord(s) - 97 > 0  and 122 - ord(s) < N:
    S[i] = "a"
    N -= 123 - ord(s)
else:
  S[i] = (chr(ord(S[i]) + N % 122 ))
  
  
print("".join(S))
# Judge status: Wrong Answer
k = int(input())
s = input()

if len(s) <= k:
    print(s)
else:
    print(s[0::k] + "...")
# Judge status: Accepted
a = int(input())
if a == 0:
  print("1")
else:
  print("0")
# Judge status: Accepted
D=int(input())
c=list(map(int,(input().split())))
s=[]
t=[]
last=[0]*26
sat=0

for i in range(D):
  s.append(list(map(int,(input().split()))))
  for day in range(26):
    if(last[day]!=0):
      last[day]+=1

  for j in range(26):
    for k in range(26):
      s[i][j]-=c[k]*(1+last[k])

  sat+=max(s[i])+c[s[i].index(max(s[i]))]
  last[s[i].index(max(s[i]))]=1
  ans=s[i].index(max(s[i]))+1

  print(ans)
# Judge status: Accepted
a, b = input().split()
ans = 0
for i in range(int(a), int(b)+1):
    if str(i)[0]==str(i)[-1] and str(i)[1]==str(i)[-2]:
        ans += 1
print(ans)
# Judge status: Accepted
import math
N = int(input())
xy = []
l = []
def comb(n,k):
  if n < k:
    n, K = k, N
  nu = 1
  de = 1
  for i in range(k):
    nu *= (N - i)
    de *= (K-i)
  return nu // de

for i in range(N):
  xy.append(list(map(int, input().split())))
for i in range(N-1):
  for j in range(i+1,N):
    l.append(math.sqrt((xy[i][0] - xy[j][0])**2 + (xy[i][1] - xy[j][1]) ** 2))

nu = math.factorial(N-2) * (N - 1) * 2
de = math.factorial(N)
ans = sum(l) * nu / de
print(ans)
# Judge status: Accepted
n,m = map(int, input().split())
al = [True]*(n+1)
for _ in range(m):
    a = int(input())
    al[a] = False

MOD = 10**9+7
dp = [0]*(n+1)
dp[0] = 1
for i in range(n):
    if i+1 <= n and al[i+1]:
        dp[i+1] += dp[i]
        dp[i+1]%=MOD
    if i+2 <= n and al[i+2]:
        dp[i+2] += dp[i]
        dp[i+2]%=MOD

print(dp[n])
# Judge status: Wrong Answer
s = input()
t = input()
c = [0 for i in range(len(s))]
flag = True
for i in range(len(s)):
    if c[i] == 0 and flag == True:
        for j in range(i,len(s)):
            if (s[i] == s[j] and t[i] != t[j]) or (s[i] != s[j] and t[i] == t[j]):
                flag = False
            else:
                c[j] = 1
if flag:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n, k = map(int, input().split())
if n%k == 0:
  print(0)
else:
  print(1)
# Judge status: Accepted
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

n = int(readline())

s = readline().rstrip().decode('utf-8')

l = 0
r = n-1
ans = 0
while l < r:
    if s[l] == "W" and s[r] == "R":
        ans += 1
        l += 1
        r -= 1
    if s[l] == "R":
        l += 1
    if s[r] == "W":
        r -= 1

print(ans)
# Judge status: Wrong Answer
w,a,b = map(int,input().split())
print(min(abs(a+w-b),abs(b+w-a)))
# Judge status: Accepted
import heapq
n,m=map(int,input().split())
ab=[list(map(int,input().split())) for i in range(n)]
ab.sort(key=lambda x:x[0])
ans=0
q=[]
heapq.heapify(q)
e=0
for i in range(1,m+1):
  while e<n and ab[e][0]==i:
    heapq.heappush(q,-ab[e][1])
    e+=1
  if len(q)>0: 
    ans-=heapq.heappop(q)
print(ans)
# Judge status: Accepted
from itertools import permutations

n = int(input())
P = tuple(map(int,input().split()))
Q = tuple(map(int,input().split()))

permutations = list(permutations(range(1,n+1)))

p = permutations.index(P)
q = permutations.index(Q)

print(abs(p-q))
# Judge status: Accepted
def hantei(s):
    return len(s) == len(set(s))

def main():
    s = input()
    s = list(s)

    if hantei(s) == True:
        print('yes') 
    else:
        print('no')
        
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import numpy as np

n,m = map(int, input().split())
from_start = np.array([])
to_end = np.array([])

for _ in range(m):
  temp = []
  temp = list(map(int, input().split()))
  if temp[0]==1:
    from_start = np.append(from_start, temp[1])
  if temp[1]==n:
    to_end = np.append(to_end, temp[0])

if from_start in to_end:
  print('POSSIBLE')
else:
  print('IMPOSSIBLE')
# Judge status: Wrong Answer
a,b = map(int,input().split())
sum = 0
for i in range(1,1000):
  if a > sum:
    sum += i
  else:
    print(sum - a)
# Judge status: Accepted
s = list(input())
t = list(input())
c = 0
for i in range(len(s)):
    if s[i] != t[i]:
        c += 1
print(c)