CodeEff/ECCO huggingface dataset:
# Original solution
#!/usr/bin/env python3
import sys
# import heapq


def solve(N: int, A: "List[int]", B: "List[int]"):

    count = 0
    flag = True
    while flag:
        flag = False
        for i in range(N):
            a, b, c = B[i-1], B[i], B[(i+1) % N]
            if b > A[i] and b > a+c:
                d, m = divmod(b-A[i], a+c)
                count += d
                B[i] = A[i]+m
                flag = True
    # print(*A)
    # print(*B)
    if A != B:
        print((-1))
        return

    print(count)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    B = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A, B)


if __name__ == '__main__':
    main()


# Optimized solution
#!/usr/bin/env python3
import sys
# import heapq


def solve(N: int, A: "List[int]", B: "List[int]"):

    count = 0
    flag = True
    while flag:
        flag = False
        for i in range(N):
            a, b, c = B[i-1], B[i], B[(i+1) % N]
            if b > A[i] and b > a+c:
                d, m = divmod(b-A[i], a+c)
                if m == 0:
                    B[i] = A[i]
                    count += d
                else:
                    d, m = divmod(b, a+c)
                    count += d
                    B[i] = m
                flag = True
    # print(*A)
    # print(*B)
    if A != B:
        count = -1

    print(count)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    B = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A, B)


if __name__ == '__main__':
    main()
# Original solution
#!/usr/bin/env python3
import sys
from heapq import heapify, heappush, heappop


def solve(N: int, A: "List[int]", B: "List[int]"):

    lh = []
    for i, b in enumerate(B):
        heappush(lh, [-b, i])

    count = 0
    while lh:
        b, i = heappop(lh)
        a, b = A[i], B[i]
        c = B[i-1]+B[(i+1) % N]
        if b > a and b >= c:
            d, m = divmod(b-a, c)
            if d == 0:
                break
            count += d
            B[i] = a+m
            if m != 0:
                heappush(lh, [-B[i], i])

    if A != B:
        count = -1

    print(count)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    B = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A, B)


if __name__ == '__main__':
    main()


# Optimized solution
#!/usr/bin/env python3
import sys
from heapq import heapify, heappush, heappop


def solve(N: int, A: "List[int]", B: "List[int]"):

    lh = []
    for i, b in enumerate(B):
        heappush(lh, (-b, i))

    count = 0
    while lh:
        b, i = heappop(lh)
        a, b, c = A[i], B[i], B[i-1]+B[(i+1) % N]
        if b > a and b > c:
            d, m = divmod(b-a, c)
            if d <= 0:
                break
            count += d
            B[i] = a+m
            if m > 0:
                heappush(lh, (-B[i], i))

    if A != B:
        count = -1

    print(count)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    B = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A, B)


if __name__ == '__main__':
    main()
# Original solution
import sys
input = sys.stdin.readline
n=int(eval(input()))
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]

from heapq import heappop, heappush
push = lambda x,i: heappush(BB,(-x,i))
BB=[]

for i,b in enumerate(B):
  push(b,i)

ans=0
while BB:
  b,ind=heappop(BB)
  b,ai=-b,A[ind]
  if b<ai:
    ans=-1
    break
  d=B[(ind-1)%n]+B[(ind+1)%n]
  dd=(b-ai)//d
  if dd==0:
    if b==ai:
      continue
    ans=-1
    break
  ans+=dd
  B[ind]-=d*dd
  push(B[ind],ind)
  
print(ans)


# Optimized solution

n=int(eval(input()))
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]

from heapq import heappop, heappush
push = lambda x,i: heappush(BB,(-x,i))
BB=[]

for i,b in enumerate(B):
  push(b,i)

ans=0
while BB:
  b,ind=heappop(BB)
  b,ai=-b,A[ind]
  if b<ai:
    ans=-1
    break
  d=B[(ind-1)%n]+B[(ind+1)%n]
  dd=(b-ai)//d
  if dd==0:
    if b==ai:
      continue
    ans=-1
    break
  ans+=dd
  B[ind]-=d*dd
  push(B[ind],ind)
  
print(ans)
# Original solution

n=int(eval(input()))
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]

from heapq import heappop, heappush
push = lambda x,i: heappush(BB,(-x,i))
BB=[]

for i,b in enumerate(B):
  push(b,i)

ans=0
while BB:
  b,ind=heappop(BB)
  b=-b
  if b<A[ind]:
    ans=-1
    break
  d=B[(ind-1)%n]+B[(ind+1)%n]
  dd=(b-A[ind])//d
  if dd==0:
    if b==A[ind]:
      continue
    ans=-1
    break
  ans+=dd
  B[ind]-=d*dd
  push(B[ind],ind)
  
print(ans)


# Optimized solution
n=int(eval(input()))
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]

from heapq import heappop, heappush
push = lambda x,i: heappush(BB,(-x,i))
BB=[]

for i,b in enumerate(B):
  push(b,i)

ans=0
while BB:
  b,ind=heappop(BB)
  b,ai=-b,A[ind]
  if b<ai:
    ans=-1
    break
  if ind==0:
    d=B[1]+B[-1]
  elif ind==n-1:
    d=B[-2]+B[0]
  else:
    d=B[ind-1]+B[ind+1]
  dd=(b-ai)//d
  if dd==0:
    if b==ai:
      continue
    ans=-1
    break
  ans+=dd
  B[ind]-=d*dd
  push(B[ind],ind)
  
print(ans)
# Original solution
n=int(eval(input()))
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]

from heapq import heappop, heappush
push = lambda x,i: heappush(BB,(-x,i))
BB=[]

for i in range(n):
  push(B[i],i)

ans=0
chk=0
while chk<n:
  b,ind=heappop(BB)
  b,ai=-b,A[ind]
  if b<ai:
    ans=-1
    break
  d=B[(ind-1)%n]+B[(ind+1)%n]
  dd=(b-ai)//d
  if dd==0:
    if b==ai:
      chk+=1
      continue
    ans=-1
    break
  ans+=dd
  B[ind]-=d*dd
  push(b-d*dd,ind)
  
print(ans)


# Optimized solution
n=int(eval(input()))
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]

from heapq import heappop, heappush
push = lambda x,i: heappush(BB,(-x,i))
BB=[]

for i,b in enumerate(B):
  push(b,i)

ans=0
while BB:
  b,ind=heappop(BB)
  b,ai=-b,A[ind]
  if b<ai:
    ans=-1
    break
  d=B[(ind-1)%n]+B[(ind+1)%n]
  dd=(b-ai)//d
  if dd==0:
    if b==ai:
      continue
    ans=-1
    break
  ans+=dd
  B[ind]-=d*dd
  push(b-d*dd,ind)
  
print(ans)
# Original solution
n=int(eval(input()))
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]

from heapq import heappop, heappush
push = lambda x,i: heappush(BB,(-x,i))
BB=[]

for i,b in enumerate(B):
  push(b,i)

ans=0
while BB:
  b,ind=heappop(BB)
  b,ai=-b,A[ind]
  if b<ai:
    ans=-1
    break
  d=B[(ind-1)%n]+B[(ind+1)%n]
  dd=(b-ai)//d
  if dd==0:
    if b==ai:
      continue
    ans=-1
    break
  ans+=dd
  B[ind]-=d*dd
  push(b-d*dd,ind)
  
print(ans)


# Optimized solution
n=int(eval(input()))
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]
key=2**18
from heapq import heappop, heappush
push = lambda x,i: heappush(BB,-(x*key+i))
BB=[]

for i,b in enumerate(B):
  push(b,i)

ans=0
while BB:
  bb=heappop(BB)
  bb=-bb
  b,ind=bb//key,bb%key
  ai=A[ind]
  if b<ai:
    ans=-1
    break
  d=B[(ind-1)%n]+B[(ind+1)%n]
  dd=(b-ai)//d
  if dd==0:
    if b==ai:
      continue
    ans=-1
    break
  ans+=dd
  B[ind]-=d*dd
  push(B[ind],ind)
  
print(ans)
# Original solution
import heapq

N = int(eval(input()))
A = list(map(int, input().split()))
Temp = input().split()
B = []
for i in range(N):
    heapq.heappush(B, (-int(Temp[i]), i))
now = list(map(int, Temp))
complete = [False]*N
fin = [True]*N
ans = 0
while True:
    v, i = heapq.heappop(B)
    if A[i] == now[i]:
        complete[i] = True

    if not complete[i]:
        if i == 0:
            nv = v + now[-1] + now[1]
        elif i == N-1:
            nv = v + now[0] + now[-2]
        else:
            nv = v + now[i-1] + now[i+1]
        if nv <= -A[i]:
            heapq.heappush(B, (nv, i))
            now[i] = -nv
            ans += 1
    if not B:
        if complete == fin:
            break
        else:
            print((-1))
            exit()
print(ans)

# Optimized solution
import heapq

N = int(eval(input()))
A = list(map(int, input().split()))
B = input().split()
C = []
for i in range(N):
    heapq.heappush(C, (A[i] - int(B[i]), i))
B = list(map(int, B))
ans = 0
while True:
    v, i = heapq.heappop(C)
    if v == 0:
        break

    nv = B[i-1] + B[(i+1) % N]
    n = -v // nv
    if n <= 0:
        print((-1))
        exit()
    v += n * nv
    B[i] -= n * nv
    heapq.heappush(C, (v, i))
    ans += n
print(ans)
# Original solution
def calc(l):
	A1=2*(l[1][0]-l[0][0])
	B1=2*(l[1][1]-l[0][1])
	C1=l[0][0]**2-l[1][0]**2+l[0][1]**2-l[1][1]**2
	A2=2*(l[2][0]-l[0][0])
	B2=2*(l[2][1]-l[0][1])
	C2=l[0][0]**2-l[2][0]**2+l[0][1]**2-l[2][1]**2
	X=(B1*C2-B2*C1)/(A1*B2-A2*B1)
	Y=(C1*A2-C2*A1)/(A1*B2-A2*B1)
	R=((X-l[0][0])**2+(Y-l[0][1])**2)**0.5
	return tuple(map(round, [X,Y,R], [3]*3))
l=[list(zip(*[iter(map(float,input().split()))]*2)) for i in range(eval(input()))]
for ll in l:
	print("%.3f %.3f %.3f"%(calc(ll)))

# Optimized solution
def calc(a,b,c,d,e,f):
	A1=2*(c-a)
	B1=2*(d-b)
	C1=a**2-c**2+b**2-d**2
	A2=2*(e-a)
	B2=2*(f-b)
	C2=a*a-e*e+b*b-f*f
	X=(B1*C2-B2*C1)/(A1*B2-A2*B1)
	Y=(C1*A2-C2*A1)/(A1*B2-A2*B1)
	R=((X-a)**2+(Y-b)**2)**0.5
	return tuple(map(round, [X,Y,R], [3]*3))
l=[list(map(float,input().split())) for i in range(eval(input()))]
for ll in l:
	print("%.3f %.3f %.3f"%(calc(*ll)))
# Original solution
for _ in range(int(eval(input()))):
    x1, y1, x2, y2, x3, y3 = list(map(float, input().split()))
    d = 2 * (x2 * y3 - x3 * y2 + x3 * y1 - x1 * y3 + x1 * y2 - x2 * y1)
    px = ((y2 - y3) * (x1 ** 2 + y1 ** 2) + (y3 - y1) * (x2 ** 2 + y2 ** 2) + (y1 - y2) * (x3 ** 2 + y3 ** 2)) / d
    py = -1 * ((x2 - x3) * (x1 ** 2 + y1 ** 2) + (x3 - x1) * (x2 ** 2 + y2 ** 2) + (x1 - x2) * (x3 ** 2 + y3 ** 2)) / d
    print(('{0:.3f} {1:.3f} {2:.3f}'.format(px, py, ((x1 - px) ** 2 + (y1 - py) ** 2) ** 0.5)))

# Optimized solution
for _ in[0]*int(eval(input())):
 a,d,b,e,c,f=list(map(float,input().split()))
 z=2*(b*f-c*e+c*d-a*f+a*e-b*d)
 x=((e-f)*(a**2+d**2)+(f-d)*(b**2+e**2)+(d-e)*(c**2+f**2))/z
 y=((c-b)*(a**2+d**2)+(a-c)*(b**2+e**2)+(b-a)*(c**2+f**2))/z
 print(('{0:.3f} {1:.3f} {2:.3f}'.format(x,y,((a-x)**2+(d-y)**2)**0.5)))
# Original solution
from random import randint

D = int(input())
C = list(map(int, input().split()))
S = [list(map(int, input().split())) for _ in range(D)]
T = []

for i in range(D):
    l = S[i].index(max(S[i]))
    T.append(l+1)
    
print(*T, sep="\n")


# Optimized solution
D = int(input())
C = list(map(int, input().split()))
S = [list(map(int, input().split())) for _ in range(D)]
T = []

for i in range(D):
    l = S[i].index(max(S[i]))
    T.append(l+1)
    
print(*T, sep="\n")
# Original solution
def main():
    from builtins import int, map, list, print, len
    from collections import defaultdict
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = (lambda: (sys.stdin.readline()).rstrip())
    input_list = (lambda: input().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    D = input_number()
    c = input_number_list()
    last = defaultdict(lambda: 0)
    s = []
    for i in range(D):
        s.append(input_number_list())
    for i in range(D):
        t_idx = 0
        t_pt = 0
        for j in range(len(s[i])):
            pt = s[i][j] + (i - last[j]) * c[j]
            if t_pt < pt:
                t_idx = j
                t_pt = pt
            elif t_pt == pt:
                if c[t_idx] < c[j]:
                    t_idx = j
                    t_pt = pt
        print(t_idx + 1)


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    from builtins import int, map, list, print, len
    from collections import defaultdict
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = (lambda: (sys.stdin.readline()).rstrip())
    input_list = (lambda: input().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    D = input_number()
    c = input_number_list()
    last = defaultdict(lambda: 0)
    s = []
    c_pt = c.copy()
    c_total = sum(c)
    ans_pt = 0
    for i in range(D):
        s.append(input_number_list())
    for i in range(D):
        pt_ls = s[i].copy()

        # 一番ポイント高いのを選ぶ
        t_idx = pt_ls.index(max(pt_ls))
        ans_pt += pt_ls[t_idx]

        # 不幸値を計算
        for j in range(len(c)):
            if j == t_idx:
                # リセット
                c_pt[j] = c[j]
            else:
                ans_pt -= c_pt[j]
                c_pt[j] += c[j]

        # 出力
        print(t_idx + 1)

        # 選択したものの不幸値をリセット
        c_pt[t_idx] = 0


if __name__ == '__main__':
    main()
# Original solution
D = int(eval(input()))
A = [[0]*26]*D
S = 0
C = list(map(int,input().split()))
P = 0
ld =[0]*26#最後に行った日の格納
l = [0]*26#損失の計算
sp = 0#一時格納
for i in range(D):
  A[i] = list(map(int,input().split()))
for j in range(D):
  maxvalue = max(A[j])
  index = A[j].index(maxvalue)
  for n in range(26):
    ld[n] = ld[n]+1
  sp = ld[index]
  ld[index] = 0 
  for k in range(26):
    l[k] = C[k]*ld[k]
  lmax =max(l)
  if 13*lmax > maxvalue:
    lindex = l.index(lmax)
    ld[index] = sp
    ld[lindex] = 0
    for m in range(26):
      l[m] = C[m]*ld[m]
  S = S+maxvalue-sum(l)
  print((index+1))

# Optimized solution
D = int(eval(input()))
A = [[0]*26]*D
S = 0
C = list(map(int,input().split()))
P = 0
ld =[0]*26#最後に行った日の格納
l = [0]*26#損失の計算
sp = 0#一時格納
t = [0]*D
for i in range(D):
  A[i] = list(map(int,input().split()))
for j in range(D):
  maxvalue = max(A[j])
  index = A[j].index(maxvalue)
  for n in range(26):
    ld[n] = ld[n]+1
  sp = ld[index]
  ld[index] = 0 
  for k in range(26):
    l[k] = C[k]*ld[k]
  lmax =max(l)
  if 13*lmax > maxvalue:
    lindex = l.index(lmax)
    ld[index] = sp
    ld[lindex] = 0
    for m in range(26):
      l[m] = C[m]*ld[m]
  S = S+maxvalue-sum(l)
  t[j] = index+1
for num in range(D):
  print((t[num]))
# Original solution
D = int(eval(input()))
C = list(map(int, input().split()))
for i in range(D):
    S = list(map(int, input().split()))
    print((S.index(max(S))+1))

# Optimized solution
D = int(eval(input()))
C = list(map(int, input().split()))
ans = []
for i in range(D):
    S = list(map(int, input().split()))
    ans.append(S.index(max(S))+1)
for e in ans:
    print(e)
# Original solution
from time import time

start = time()
D = int(eval(input()))
C = [int(i) for i in input().split()]
scores = [[int(i) for i in input().split()] for j in range(D)]
t = []
for i in scores:
    t.append(i.index(max(i))+1)
DC = [0]*26

def calcScore(t):
    score = []
    S = 0
    last = [0]*26
    for d in range(1,D+1):
        S += scores[d-1][t[d-1]-1]
        last[t[d-1]-1] = d
        for i in range(26):
            S -= C[i] * (d - last[i])
            DC[i] += (d - last[i])
        score.append(S)
    return score[-1]

ts = calcScore(t)
i = 0
j = 1
while time() - start < 2:
    d,q = i, j
    temp = [t[i] if d-1 != i else q for i in range(D)]
    j += 1
    if calcScore(temp) > ts:
        t = temp
        i += 1
        j = 0

print(("\n".join(map(str, t))))

# Optimized solution
from time import time

start = time()
D = int(eval(input()))
C = [int(i) for i in input().split()]
scores = [[int(i) for i in input().split()] for j in range(D)]
t = []
for i in scores:
    t.append(i.index(max(i))+1)
DC = [0]*26

def calcScore(t):
    score = []
    S = 0
    last = [0]*26
    for d in range(1,D+1):
        S += scores[d-1][t[d-1]-1]
        last[t[d-1]-1] = d
        for i in range(26):
            S -= C[i] * (d - last[i])
            DC[i] += (d - last[i])
        score.append(S)
    return score[-1]

ts = calcScore(t)
i = 0
j = 1
while time() - start < 1.95:
    d,q = i, j
    temp = [t[i] if d-1 != i else q for i in range(D)]
    j += 1
    if calcScore(temp) > ts:
        t = temp
        i += 1
        j = 0

print(("\n".join(map(str, t))))
# Original solution
from time import time

start = time()
D = int(eval(input()))
C = [int(i) for i in input().split()]
scores = [[int(i) for i in input().split()] for j in range(D)]
t = []
for i in scores:
    t.append(i.index(max(i))+1)
DC = [0]*26

def calcScore(t):
    score = []
    S = 0
    last = [0]*26
    for d in range(1,D+1):
        S += scores[d-1][t[d-1]-1]
        last[t[d-1]-1] = d
        for i in range(26):
            S -= C[i] * (d - last[i])
            DC[i] += (d - last[i])
        score.append(S)
    return score[-1]

ts = calcScore(t)
i = 0
j = 1
while time() - start < 1.95:
    d,q = i, j
    temp = [t[i] if d-1 != i else q for i in range(D)]
    j += 1
    if calcScore(temp) > ts:
        t = temp
        i += 1
        j = 0

print(("\n".join(map(str, t))))

# Optimized solution
from time import time

start = time()
D = int(eval(input()))
C = [int(i) for i in input().split()]
scores = [[int(i) for i in input().split()] for j in range(D)]
t = []
for i in scores:
    t.append(i.index(max(i))+1)
DC = [0]*26

def calcScore(t):
    score = []
    S = 0
    last = [0]*26
    for d in range(1,D+1):
        S += scores[d-1][t[d-1]-1]
        last[t[d-1]-1] = d
        for i in range(26):
            S -= C[i] * (d - last[i])
            DC[i] += (d - last[i])
        score.append(S)
    return score[-1]

from random import randint
ts = calcScore(t)
i = 0
while time() - start < 1.8:
    d,q = i, randint(1,26)
    temp = [t[i] if d-1 != i else q for i in range(D)]
    if calcScore(temp) > ts:
        t = temp
        i += 1

print(("\n".join(map(str, t))))
# Original solution
d=int(eval(input()))
C=[int(i) for i in input().split()]
s=[[int(i) for i in input().split()] for q in range(d)]

sco=0
L=[0 for i in range(26)]
ans=[]

#calc
for i in range(d):
    mayou=0
    est=s[i][0]+C[0]*(i+1-L[0])
    for p in range(1,26):
        if s[i][p]+C[p]*(i+1-L[p]) > est:
            mayou=p
            est=s[i][p]+C[p]*(i+1-L[p])
    ans.append(mayou)
    print((mayou+1)) #output


##以下表示
"""
L=[0 for i in range(26)]
for q in range(d):
    t=ans[q]
    sco+=s[q][t]
    
    
    L[t]=q+1
    for i in range(26):
        if L[i]!=-1:
            sco-=C[i]*(q+1-L[i])
    
    print(sco)
"""


# Optimized solution
d=int(eval(input()))
C=[int(i) for i in input().split()]
s=[[int(i) for i in input().split()] for q in range(d)]

sco=0
L=[0 for i in range(26)]
ans=[]

#calc
for i in range(d):
    mayou=0
    est=s[i][0]+C[0]*(i+1-L[0])
    for p in range(1,26):
        if s[i][p]+C[p]*(i+1-L[p]) > est:
            mayou=p
            est=s[i][p]+C[p]*(i+1-L[p])
    ans.append(mayou)
    print((mayou+1)) #output
# Original solution
def choose(D, c, s, d, last, depth, p):
    maxpoint = -999999
    maxnum = 0
    if depth > 0 and d < D:
        for i in range(26):
            point = p
            point += s[d][i]
            point += changepoint(c, d, i, last)
            nlast = []
            nlast.extend(last)
            nlast[i] = d
            z, point = choose(D, c, s, d+1, nlast, depth-1, point)
            if point > maxpoint:
                maxpoint = point
                maxnum = i
        return maxnum, maxpoint
    return 0, p


def changepoint(c, d, num, last):
    point = 0
    for j in range(26):
        if j != num:
            point -= c[j]*(d-last[j])
    return point


def main():
    D = int(eval(input()))
    c = list(map(int, input().split()))
    s = []
    last = [-1]*26
    for _ in range(D):
        s.append(list(map(int, input().split())))
    point = 0
    for i in range(D):
        num, point = choose(D, c, s, i, last, 2, 0)
        print((num+1))


main()


# Optimized solution

def choose(D, c, s, d, last, depth, p):
    maxpoint = -999999
    maxnum = 0
    if depth > 0 and d < D:
        for i in range(26):
            point = p
            point += s[d][i]
            point += changepoint(c, d, i, last)
            nlast = []
            nlast.extend(last)
            nlast[i] = d
            z, point = choose(D, c, s, d+1, nlast, depth-1, point)
            if point > maxpoint:
                maxpoint = point
                maxnum = i
        return maxnum, maxpoint
    return 0, p


def changepoint(c, d, num, last):
    point = 0
    for j in range(26):
        if j != num:
            point -= c[j]*(d-last[j])
    return point


def main():
    D = int(eval(input()))
    c = list(map(int, input().split()))
    s = []
    last = [-1]*26
    for _ in range(D):
        s.append(list(map(int, input().split())))
    point = 0
    for i in range(D):
        num, point = choose(D, c, s, i, last, 1, 0)
        print((num+1))


main()