Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

N = int(input())
A = []
ans = 0

for _ in range(N):
  A.append(int(input()))
  
S = set(A)

for i in set(A):
  if A.count(i)%2 == 1:
    ans += 1
    
print(ans)

### FIXED CODE ###

N = int(input())
A = []
count = 1
ans = 0

for _ in range(N):
  A.append(int(input()))

A.sort()

for i in range(N-1):
  if A[i] == A[i+1]:
    count += 1
  else:
    if count%2 == 1:
      ans += 1
    count = 1
else:
  if count%2 == 1:
    ans += 1
  else:
    count = 1

print(ans)
### BUGGY CODE ###

N = int(input())
A = [int(input()) for _ in range(N)]

C = [[A[0]]]
head = [A[0]]
for i in range(N-1):
    for j, h in enumerate(head):
        if A[i+1] > h:
            C[j].append(A[i+1])
            head[j] = A[i+1]
            break
    else:        
        C.append([A[i+1]])  # new color
        head.append(A[i+1])

print(len(C))


### FIXED CODE ###

import bisect

N = int(input())
A = [int(input()) for _ in range(N)]

def LIS(A):
    """
    returns Longest Increasing Subsequence of list A.
    """
    B = [A[0]]
    for i in range(N-1):
        if A[i+1] >= B[-1]:
            B.append(A[i+1])
        else:
            index = bisect.bisect_left(B, A[i+1])
            B[index] = A[i+1]
    return B

def LDS(A):
    """
    returns Longest Decreasing Subsequence of list A.
    """
    A = A[::-1]
    B = [A[0]]
    for i in range(N-1):
        if A[i+1] >= B[-1]:
            B.append(A[i+1])
        else:
            index = bisect.bisect_right(B, A[i+1])
            B[index] = A[i+1]
    return B[::-1]


print(len(LDS(A)))
### BUGGY CODE ###

K = input()
D = int(input())
mod = 10 ** 9 + 7

length = len(K)
dp = [[[0] * D for _ in range(2)] for _ in range(length + 1)]
dp[0][0][0] = 1

for i in range(length):
    for j in range(2):
        for k in range(D):
            if j == 1:
                x = 9
            else:
                x = int(K[i])
            for d in range(x + 1):
                dp[i + 1][j or d < x][(k + d) % D] += dp[i][j][k]
                dp[i + 1][j or d < x][(k + d) % D] %= mod
ans = 0
for i in range(2):
    ans += dp[length][i][0]

print((ans - 1) % mod)


### FIXED CODE ###

K = list(map(int, input()))
D = int(input())

mod = 10 ** 9 + 7

next_dp = [0] * D
border = 0

for current_digit in K:
    dp, next_dp = next_dp, [0] * D
    for current_mod, cnt in enumerate(dp):
        for next_mod in range(current_mod, current_mod + 10):
            next_dp[next_mod % D] += cnt

    for next_mod in range(border, current_digit + border):
        next_dp[next_mod % D] += 1

    border = (border + current_digit) % D

    for i in range(D):
        next_dp[i] %= mod
print((next_dp[0] + (border == 0) - 1) % mod)
### BUGGY CODE ###

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

def resolve():
    n=int(input())
    l=list(map(int,input().split()))
    lans=[]
    for i in range(1,n):
        lans.append(abs(sum(l[:i])-sum(l[i:])))
    print(min(lans))
resolve()

### FIXED CODE ###

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

def resolve():
    from itertools import accumulate

    N = int(input())  # len(A)
    A = list(map(int, input().split()))
    zenbu=sum(A)
    B = [0] + A
    B = list(accumulate(B))  # 累積和を格納したリスト作成


    ans=10**18
    for i in range(1, N):
        ans = min(abs(B[i]-(zenbu-B[i])),ans)
    print(ans)

resolve()
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
limit=10**18

ans = 1
for i in range(n):
  ans *= a[i]
  if a[i] == 0:
    break

if ans > limit:
  print(-1)
else:
  print(ans)


### FIXED CODE ###

# from operator import mul
# from functools import reduce

n=int(input())
a=list(map(int, input().split()))
# limit=10**18

# if 0 in a:
#     print(0)
#     exit()

ans = 1
# ans = reduce(mul, a) #=> 1320

for i in range(n):
  ans *= a[i]
  if ans > 10 ** 18:
  # if a[i] == 0:
  #   break
  # elif (ans*a[i]) > limit:
    ans = -1
    break

for i in range(n):
  if a[i] == 0:
      ans = 0

# if ans > limit:
#   print(-1)
# else:
print(ans)
### BUGGY CODE ###

import sys

K = int(input())
num = 7
cnt = 0
Len = len(str(K))

for n in range(0,10000000):
    cnt += 1
    if (int(num)%K)==0:
        ans = int(num) % K
        break
    else:
        num = num * 10 + 7
print(cnt)


### FIXED CODE ###

K = int(input())
x = 7%K
ans = -1

for n in range(1,K+10):
    if x==0:
        ans = n
        break

    x = (x * 10 + 7)%K
print(ans)
### BUGGY CODE ###

def main():
    n, m = map(int, input().split())
    a = list(map(lambda x: int(x)-1, input().split()))
    event = [[] for _ in [0]*m]
    for j, i in enumerate(a):
        if j < n-1:
            A = m-a[j+1]
            if A < m:
                event[A].append((True, j))
        B = m-i
        if B < m:
            event[B].append((False, j))
    leader = 1
    now = a[-1]
    for i in range(n-1):
        if a[i] > a[i+1]:
            leader += 1
            now += a[i]
    s = a[0]
    ans = 10**20
    for i in range(m):
        b = list(map(lambda x: (x+i) % m, a))
        for e, j in event[i]:
            if e:
                leader += 1
                now += ((a[j]+i) % m)
            else:
                now -= m
                if j != n-1:
                    leader -= 1
        now += leader
        ans = min(ans, now-1-(s+i) % m)
    print(ans)


main()


### FIXED CODE ###

def main():
    n, m = map(int, input().split())
    a = list(map(lambda x: int(x)-1, input().split()))
    event = [[] for _ in [0]*m]
    for j, i in enumerate(a):
        if j < n-1:
            A = m-a[j+1]
            if A < m:
                event[A].append((True, j))
        B = m-i
        if B < m:
            event[B].append((False, j))
    leader = 1
    now = a[-1]
    for i in range(n-1):
        if a[i] > a[i+1]:
            leader += 1
            now += a[i]
    s = a[0]
    ans = 10**20
    for i in range(m):
        for e, j in event[i]:
            if e:
                leader += 1
                now += ((a[j]+i) % m)
            else:
                now -= m
                if j != n-1:
                    leader -= 1
        now += leader
        ans = min(ans, now-1-(s+i) % m)
    print(ans)


main()
### BUGGY CODE ###

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

def price(x):
    return x // 2


for i in range(m):
    x = a.pop()
    a.append(price(x))
    a.sort()

print(sum(a))

### FIXED CODE ###

import heapq
n, m = map(int, input().split())
price = list(map(lambda x: int(x) * (-1), input().split()))

heapq.heapify(price)
for _ in range(m):
    max_price = -heapq.heappop(price)
    heapq.heappush(price, -(max_price//2))

ans = -sum(price)
print(ans)
### BUGGY CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
 
for _ in range(min(k,41)):
    s=[0 for _ in range(n)]
    e=[0 for _ in range(n)]
    for i in range(n):
        d=a[i]
        s[max(0,i-d)]+=1
        e[min(n-1,i+d)]+=1
    a[0]=s[0]
    for i in range(1,n):
        s[i]=s[i-1]+s[i]
        e[i]=e[i-1]+e[i]
        a[i]=s[i]-e[i-1]
 
print(*a)

### FIXED CODE ###

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

for _ in range(min(k,100)):
    s=[0 for _ in range(n)]
    e=[0 for _ in range(n)]
    for i in range(n):
        d=a[i]
        s[max(0,i-d)]+=1
        e[min(n-1,i+d)]+=1
    a[0]=s[0]
    for i in range(1,n):
        s[i]=s[i-1]+s[i]
        e[i]=e[i-1]+e[i]
        a[i]=s[i]-e[i-1]

print(*a)
### BUGGY CODE ###

import sys

n,p=list(map(int,input().split()))
s=[int(x) for x in sys.stdin.readline().strip()]
reslst=[0]*p

cnt=0

if p==2:
    for i in range(n):
        if s[i]%2==0:
            cnt+=i+1
elif p==5:
    for i in range(n):
        if s[i]==5 or s[i]==0:
            cnt+=i+1
else:
    x=0
    for i in range(n-1,-1,-1):
        x=s[i]*(10**(n-1-i))+x
        reslst[x%p]+=1
    reslst[0]+=1

    for i in range(p):
        j=reslst[i]

        cnt+=j*(j-1)//2

print(cnt)

### FIXED CODE ###

import sys

n,p=list(map(int,input().split()))
s=sys.stdin.readline().strip()
reslst=[0]*p

cnt=0

if p==2:
    for i in range(n):
        if int(s[i])%2==0:
            cnt+=i+1
elif p==5:
    for i in range(n):
        if s[i]=='5' or s[i]=='0':
            cnt+=i+1
else:
    reslst[0]+=1
    tmp=1
    now=0
    for i in [int(x) for x in s[::-1]]:
        now+=i*tmp
        now%=p
        reslst[now]+=1
        tmp=(tmp*10)%p
    
    for i in range(p):
        cnt+=reslst[i]*(reslst[i]-1)//2

print(cnt)
### BUGGY CODE ###

n, x, y = map(int,input().split())

ans_list = [0]*(n)
for i in range(1, n+1):
    for j in range(1, n+1):
        if i>j:
            min_dis = min(abs(j-i), abs(x-i) + 1 + abs(j-y), abs(y-i)+1+abs(j-x))
            ans_list[min_dis] += 1

for i in range(1, len(ans_list)):
    print(ans_list[i])

### FIXED CODE ###

n, x, y = map(int,input().split())

ans_list = [0]*(n)
for i in range(1, n+1):
    for j in range(i+1, n+1):
            min_dis = min(abs(j-i), abs(x-i) + 1 + abs(j-y), abs(y-i)+1+abs(j-x))
            ans_list[min_dis] += 1

for i in range(1, len(ans_list)):
    print(ans_list[i])
### BUGGY CODE ###

n=int(input())
ans=[]
for i in range(1,10**8):
    if i>=n:
        break
    elif n%i==0:
        ans.append(i+(n//i))
print(min(ans)-2)


### FIXED CODE ###

n=int(input())
ans=[]
for i in range(1,10**7):
    if i>=n:
        break
    elif n%i==0:
        ans.append(i+(n//i))
print(min(ans)-2)
### BUGGY CODE ###

N=int(input())
A=[]
for i in range(N):
    A.append(int(input()))
ans=1
li=[A[0]]
for i in range(1,N):
    ans+=1 if li.count(A[i])%2==0 else -1
    li.append(A[i])
print(ans)

### FIXED CODE ###

N=int(input())
A=[]
for i in range(N):
    A.append(int(input()))
B=sorted(A)
ans=0
tmp=B[0]
cnt=1
for i in range(1,N):
    if(tmp==B[i]):
        cnt+=1
    else:
        ans+=(cnt%2)
        cnt=1
        tmp=B[i]
ans+=cnt%2
print(ans)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**9) #上限を１００万回に設定

N, K = map(int, input().split())
h = list(map(int, input().split()))
f_INF = float('inf')
dp = [f_INF]*N
dp[0] = 0
for i in range(N):
    for j in range(1,min(K+1, N-i)):
        dp[i+j] = min(dp[i+j],dp[i] + abs(h[i]-h[i+j]))
print(dp[N-1])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9) #上限を１００万回に設定

N, K = map(int, input().split())
h = list(map(int, input().split()))
f_INF = float('inf')
dp = [f_INF]*N
dp[0] = 0
for i in range(N):
    for j in range(1,min(K+1, N-i)):
        dp[i+j] = min(dp[i+j],dp[i] + abs(h[i]-h[i+j]))
print(dp[N-1])
### BUGGY CODE ###

import itertools,copy
T = input()
TC = list(T)
N = [i for i, x in enumerate(TC) if x == '?']
B = list(itertools.product(['P','D'], repeat=len(N)))
point = [0]*len(B)
strs = ['']*len(B)
for b,i in zip(B,range(len(B))):
    TC = list(T)
    for n,j in zip(N,range(len(N))):
        TC[n] = b[j]
    TC = ''.join(TC)
    strs[i] = TC
    point[i] = TC.count('PD') + TC.count('D')
maxin = max(point)

print(strs[point.index(maxin)])

### FIXED CODE ###

#BBBBBBBBBBB

import sys
import math
import itertools
import collections
import heapq
import numpy as np

rl = sys.stdin.readline

t = rl()
li = []
for i in range(len(t)):
    if t[i] == '?':
        li.append('D')
    else:
        li.append(t[i])
print(''.join(li))
### BUGGY CODE ###

n=int(input())
p=list(map(int,input().split()))
a=1
for i in range(1,n):
    if min(p[:i])>=p[i]:
        a+=1
print(a)

### FIXED CODE ###

n=int(input())
p=list(map(int,input().split()))
a=1
f=p[0]
for i in range(1,n):
    f=min(f,p[i])
    if f>=p[i]:
        a+=1
print(a)
### BUGGY CODE ###

#!/usr/bin/python3
# -*- coding:utf-8 -*-
import numpy

def main():
  n, k = map(int, input().strip().split())
  Ps   = numpy.array(input().strip().split(), dtype=int)
  Es   = numpy.zeros(n)
  max = -1
  for i, P in enumerate(Ps):
    Es[i] = 0.5 * (P+1)
  max = -1
  for i in range(n-k+1):
    x = numpy.sum(Es[i:i+k])
    if max < x:
      max = x
  print(max)

if __name__=='__main__':
  main()

### FIXED CODE ###

#!/usr/bin/python3
# -*- coding:utf-8 -*-
import numpy

def main():
  n, k = map(int, input().strip().split())
  Ps   = numpy.array(input().strip().split(), dtype=int)
  Es   = numpy.zeros(n+1)
  max = -1
  for i, P in enumerate(Ps):
    Es[i] = 0.5 * (P+1) + Es[i-1]
  max = -1
  for i in range(n-k+1):
    x = Es[i+k-1] - Es[i-1]
    if max < x:
      max = x
  print(max)

if __name__=='__main__':
  main()
### BUGGY CODE ###

n = int(input())
i = 1
divisor = (1 + n) // 2
min_value = 10 ** 10 + 1
while i <= divisor:
    if n % i == 0:
        divisor = n // i
        if max(len(str(i)),len(str(n // i))) > min_value:
            break
        min_value = min(min_value,max(len(str(i)),len(str(n // i))))
    i += 1
print(min_value)


### FIXED CODE ###

n = int(input())
i = 1
divisor = n ** 0.5
min_value = 10 ** 10 + 1
while i < divisor + 1:
    if n % i == 0:
        min_value = min(min_value,max(len(str(i)),len(str(n // i))))
    i += 1
print(min_value)
### BUGGY CODE ###

A = list(map(int , input().split()))
B = list(map(int , input().split()))
tes = 0.0
SS = {sum(B[i:i+A[1]]):B[i:i+A[1]] for i in range(len(B)-A[1]+1)}
tes += sum([sum(i) for i in [[float(1/len(list(range(1,max(SS.values())[i]+1)))*x) for x in list(range(1,max(SS.values())[i]+1))] for i in range(len(max(SS.values())))]]) 
print(float(tes))

### FIXED CODE ###

A = list(map(int , input().split()))
B = list(map(int , input().split()))
kitaiti =[(i+1)/2 for i in B]
ans = []
dd = [0]
for i in range(A[0]):
    dd.append(dd[i] + kitaiti[i])
for i in range(A[1] , A[0]+1):
    ans.append(dd[i] - dd[i - A[1]])
print(max(ans))
### BUGGY CODE ###

import numpy as np
import sys
input = sys.stdin.buffer.readline

N = int(input())
A = list(map(int, (input().split())))
A.sort()
cnt = np.zeros(10**6+10, dtype=np.int32)
for i in range(N):
    cnt[A[i]] += 1
for i in range(N-1):
    cnt[A[i]*2::A[i]] = 0
ans = np.count_nonzero(cnt==1)
print(ans)

### FIXED CODE ###

import numpy as np
import sys
input = sys.stdin.buffer.readline

N = int(input())
A = list(map(int, (input().split())))
A.sort()
cnt = np.zeros(10**6+10, dtype=np.int32)
for x in A:
    if cnt[x] != 0:
        cnt[x] = 2
        continue
    cnt[x::x] += 1
ans = 0
for x in A:
    if cnt[x] == 1:
        ans += 1
print(ans)
### BUGGY CODE ###

#E
import numpy as np
N = int(input())
A = list(map(int, input().split()))
x = 0
listi = []
listj = []
for i in range(N):
    listi.append(i + A[i])  
for j in range(N):
    listj.append(j - A[j])
for i in range(N):
    for j in range(N):
        if i < j and listi[i] == listj[j]:
            x += 1
print(x)

### FIXED CODE ###

import numpy as np
N = int(input())
A = list(map(int, input().split()))
d = {}
x = 0

for i, a in enumerate(A):
    if i+a not in d:
        d[i+a] = 1
    else:
        d[i+a] += 1
    if i-a in d:
        x += d[i-a] 

print(x)
### BUGGY CODE ###

import math
N = int(input())


def f(n):
    m = int(math.sqrt(n)+0.5)
    res = 0
    for x in range(1, m+1):
        for y in range(1, m+1):
            for z in range(1, m+1):
                tmp = x*x + y * y + z*z + x * y + y*z + z*x
                if tmp == n:
                    res += 1
                elif tmp > n:
                    break
    return res


for i in range(1, N+1):
    print(f(i))


### FIXED CODE ###

import math
N = int(input())


def f(n):
    m = int(math.sqrt(n)+0.5)
    res = 0
    for x in range(1, m+1):
        for y in range(x, m+1):
            k = n - (x * x + y * y + x * y)
            if k < 1:
                break
            l = y
            r = m+1
            while r - l > 1:
                z = (r + l) // 2
                tmp = (x + y + z) * z
                if tmp <= k:
                    l = z
                else:
                    if r == z + 1:
                        r -= 1
                    else:
                        r = z + 1
            if (x+y+l) * l == k:
                s = set()
                s.add(x)
                s.add(y)
                s.add(l)
                if len(s) == 3:
                    res += 6
                elif len(s) == 2:
                    res += 3
                else:
                    res += 1
    return res


for i in range(1, N+1):
    print(f(i))
### BUGGY CODE ###

A,B,C,K = map(int,input().split(' '))

ans = 0
for i in range(K):
    if A > 0:
        ans += 1
        A -= 1
    elif A == 0 and B > 0:
        B -= 1
    else:
        ans -= 1
        C -= 1
print(ans)

### FIXED CODE ###

A,B,C,K = map(int,input().split(' '))

if K <= A:
    print(K)
elif A < K <= A + B:
    print(A)
else:
    print(2*A + B - K)
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
if n % 2 == 0:
    for i in range(n//2):
        if not a.count(2*i+1) == 2:
            print(0)
            break
    else: print(2**(n//2) % 1000000007)
else:
    for i in range(1,n//2+1):
        if not a.count(2*i) == 2:
            print(0)
            break
    else:
        if a.count(0) == 1:
            print(2**(n//2) % 1000000007)
        else: print(0)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
a.sort()
if n % 2 == 1:
    if a[0] != 0:
        print(0)
    else:
        for i in range(2, n, 2):
            if not i == a[i-1] == a[i]:
                print(0)
                break
        else: print((2**(n//2))%1000000007)
else:
    for i in range(1, n, 2):
        if not i == a[i-1] == a[i]:
            print(0)
            break
    else: print((2**(n//2))%1000000007)
### BUGGY CODE ###

from operator import mul
from functools import reduce
def comb2(n,r):
    r = min(n - r, r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under

import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
mod = 10**9 + 7
inf = float('inf')
ans = int(0)

N, M, K = LI()

cou = int(0)
#maxL = N + M -2
L = int(0)
#距離i+1の組み合わせ

#for i in range(maxL):
for j in range(N):
    L += (N - j - 1) * (M ** 2) * (j + 1)
for j in range(M):
    L += (M - j - 1) * (N ** 2) * (j + 1)
#    for j in range(i+2):
#        if i>1 and i+1>j>0:
#            L[i] += max((N-j)*(M-(1+i)+j),0)*(i+1)*2
#        else:
#            L[i] += max(((N - j) * (M - (1 + i) + j)), 0) * (i + 1)

cou = comb2(N*M-2,K-2)%mod

ans = cou *L%mod

print(ans)

### FIXED CODE ###

def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

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

C = comb(N*M-2, K-2)
#print(int(C))

A = int(0)
for d in range(N):
    a = (N-d)*(M**2)

    A += int(d*a)

B = int(0)
for d in range(M):
    b = (M-d)*(N**2)
    B += int(d*b)

ans = int((A+B)*C)
ans = ans%(1000000007)
print(ans)
### BUGGY CODE ###

import sys

input = sys.stdin.readline
n, m = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(m)]
BC.sort(key=lambda x: -x[1])

extend = A.extend
[extend([BC[i][1]] * BC[i][0]) for i in range(m)]

A.sort(reverse=True)
print(sum(A[:n]))

### FIXED CODE ###

import sys

input = sys.stdin.readline
n, m = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(m)]
BC.sort(key=lambda x: -x[1])

maxi = n*2
extend = A.extend
[extend([ls[1]] * ls[0]) for ls in BC if len(A) <= maxi]
A.sort(reverse=True)

print(sum(A[:n]))
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def printlist(lst, k='\n'): print(k.join(list(map(str, lst))))
INF = float('inf')

def solve():
    n, k = MI()
    H = LI()

    dp = [INF] * n
    dp[0] = 0
    def f(a, b):
        return abs(a - b)
    for i in range(n):
        for j in range(1, k+1):
            if i + j < n:
                dp[i+j] = min(dp[i+j], dp[i] + f(H[i], H[i+j]))
    print(dp[i])


if __name__ == '__main__':
    solve()


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def printlist(lst, k='\n'): print(k.join(list(map(str, lst))))
INF = float('inf')

def solve():
    n, k = MI()
    H = LI()

    dp = [INF] * n
    dp[0] = 0
    def f(a, b):
        return abs(a - b)
    for i in range(n):
        for j in range(1, k+1):
            if i + j < n:
                dp[i+j] = min(dp[i+j], dp[i] + f(H[i], H[i+j]))
    print(dp[i])


if __name__ == '__main__':
    solve()
### BUGGY CODE ###

import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")
import random
import time
start_time = time.time()
D = int(input())
c = [int(x) for x in input().split()]
s = []
for _ in range(D):
    s.append([int(x) for x in input().split()])
t = [random.randint(1, 26) for x in range(D)]

def solve(t):
    last = [0]*26
    ans = 0
    for i in range(1, D + 1):
        ans += s[i - 1][t[i - 1] - 1]
        last[t[i - 1] - 1] = i
        for j in range(26):
            ans -= c[j]*(i - last[j])
    return ans
ans = solve(t)
while True:
    now_time = time.time()
    if now_time - start_time > 2:
        print(*t, sep='\n')
        break
    d, q = [random.randint(1, D), random.randint(1, 26)]
    temp = t[d - 1]
    t[d - 1] = q
    ans_2 = solve(t)
    if ans_2 > ans:
        ans = ans_2
    else:
        t[d - 1] = temp



### FIXED CODE ###

import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")
import random
D = int(input())
c = [int(x) for x in input().split()]
s = []
for _ in range(D):
    s.append([int(x) for x in input().split()])
t = [random.randint(1, 26) for x in range(D)]
last = [0]*26
ans = 0
for i in range(1, D + 1):
    ans += s[i - 1][t[i - 1] - 1]
    last[t[i - 1] - 1] = i
    for j in range(26):
        ans -= c[j]*(i - last[j])
    #print(ans)
print(*t, sep="\n")