Problem:
   Problem Statement AtCoder currently hosts three types of contests: ABC, ARC, and AGC. As the number of users has grown, in order to meet the needs of more users, AtCoder has decided to increase the number of contests to 26 types, from AAC to AZC. For convenience, we number these 26 types as type 1 through type 26. AtCoder wants to schedule contests for D days so that user satisfaction is as high as possible. For every day, AtCoder will hold exactly one contest, and each contest will end on that day. The satisfaction is calculated as follows.   The satisfaction at the beginning of day 1 is 0. Satisfaction can be negative.  Holding contests increases satisfaction. The amount of increase will vary depending on a variety of factors. Specifically, we know in advance that holding a contest of type i on day d will increase the satisfaction by s_{d,i} .  If a particular type of contest is not held for a while, the satisfaction decreases. Each contest type i has an integer c_i , and at the end of each day d=1,2,...,D , the satisfaction decreases as follows. Let \mathrm{last}(d,i) be the last day before day d (including d ) on which a contest of type i was held. If contests of type i have never been held yet, we define \mathrm{last}(d,i)=0 . At the end of day d , the satisfaction decreases by \sum _{i=1}^{26}c_i \times (d-\mathrm{last}(d,i)) .   Please schedule contests on behalf of AtCoder.
If the satisfaction at the end of day D is S , you will get a score of \max(10^6 + S, 0) .
There are 50 test cases, and the score of a submission is the total scores for each test case.
You can make submissions multiple times, and the highest score among your submissions will be your score.      Constraints  D = 365  Each c_i is an integer satisfying 0\leq c_i \leq 100 .  Each s_{d,i} is an integer satisfying 0\leq s_{d,i} \leq 20000 .         Input Input is given from Standard Input in the following format:  D  c_1  c_2  \cdots  c_{26}  s_{1,1}  s_{1,2}  \cdots  s_{1,26}  \vdots  s_{D,1}  s_{D,2}  \cdots  s_{D,26}       Output Let t_d ( 1\leq t_d \leq 26 ) be the type of the contest that will be held at day d .
Print D integers t_d to Standard Output in the following format:  t_1  t_2  \vdots  t_D   Any output that does not follow the above format may result in 0 points WA for that test case.      Input Generation Each integer c_i and s_{d,i} is generated independently and uniformly at random from the integers in the range described in the problem statement.        Sample Input 1 5
86 90 69 51 2 96 71 47 88 34 45 46 89 34 31 38 97 84 41 80 14 4 50 83 7 82
19771 12979 18912 10432 10544 12928 13403 3047 10527 9740 8100 92 2856 14730 1396 15905 6534 4650 11469 3628 8433 2994 10899 16396 18355 11424
6674 17707 13855 16407 12232 2886 11908 1705 5000 1537 10440 10711 4917 10770 17272 15364 19277 18094 3929 3705 7169 6159 18683 15410 9092 4570
6878 4239 19925 1799 375 9563 3445 5658 19857 11401 6997 6498 19933 3848 2426 2146 19745 16880 17773 18359 3921 14172 16730 11157 5439 256
8633 15862 15303 10749 18499 7792 10317 5901 9395 11433 3514 3959 5202 19850 19469 9790 5653 784 18500 10552 17975 16615 7852 197 8471 7452
19855 17918 7990 10572 4333 438 9140 9104 12622 4985 12319 4028 19922 12132 16259 17476 2976 547 19195 19830 16285 4806 4471 9457 2864 2192      Sample Output 1 1
17
13
14
13  Note that this example is a small one for checking the problem specification. It does not satisfy the constraint D=365 and is never actually given as a test case. The final satisfaction with this output is 79325, so the score is 1079325.  Input generator, score calculator, and visualizer      Beginner's Guide If you don't know what to do, proceed to problem B or C.

Solution (Python):

from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
import random
import time
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    def score(t):
        n = 26
        v = 0
        minus = sum_ = sum(c)
        last = [0]*n
        for i in range(d):
            ti = t[i]-1
            minus -= (i+1-last[ti])*c[ti]
            v += s[i][ti]-minus
            minus += sum_
            last[ti] = i+1
        return v
    start = time.time()
    d = I()
    c = LI()
    s = LIR(d)
    n = 26
    t = []
    for i in range(d):
        argmax = 0
        m = s[i][0]
        for j in range(1,n):
            sj = s[i][j]
            if m < sj:
                argmax = j
                m = sj
        t.append(argmax+1)
    v = score(t)
    nt = [(i%n)+1 for i in range(d)]
    nv = score(t)
    if v < nv:
        t = [i for i in nt]
        v = nv
    i = 0
    while time.time() < 1.5+start:
        nt = [i for i in t]
        r = random.random()
        if r > 0.5:
            if nt[i] < n:
                nt[i] += 1
        else:
            if nt[i] > 1:
                nt[i] -= 1
        nv = score(nt)
        if v < nv:
            t = [i for i in nt]
            v = nv
        i += 1
        i %= d
    for i in t:
        print(i)
    return


if __name__ == "__main__":
    solve()

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

for A in S:
    print(A.index(max(A)) + 1)

Solution (Python):
import random


def main():
    D = int(input())
    c = list(map(int, input().split()))
    s = [list(map(int, input().split())) for _ in range(D)]

    for i in range(D):
        print(random.randrange(1, 27))


if __name__ == "__main__":
    main()

Solution (Python):
T = 26

D = int(input())
cs = list(map(int, input().split()))
ss = [list(map(int, input().split())) for _ in range(D)]

def greedy(D, cs, ss):
    ts = []
    last = [0] * T
    for d in range(D):
        d_true = d + 1
        diffs = []
        ssc = ss[d]
        for t in range(T):
            s = ssc[t]
            d = s + cs[t] * (d_true - last[t])
            diffs.append((d, t))
        
        dc, tc = max(diffs)
        last[tc] = d_true
        ts.append(tc)
    
    return ts


ts = greedy(D, cs, ss)
ts = [t + 1 for t in ts]

for t in ts:
    print(t)

Solution (Python):
def main():
    d = int(input())
    c = [int(v) for v in input().split()]
    last = [-1] * 26
    s = []
    for _ in range(d):
        s.append([int(v) for v in input().split()])

    td = 0
    for i in range(d):
        td0 = td
        dmax = -99999999
        tmax = 0
        for test in range(26):
            diff = s[i][test]
            for j in range(26):
                if j != i:
                    diff -= c[j]*(i-last[j])
            if diff>dmax:
                dmax = diff
                tmax = test
        print(tmax+1)

main()

Solution (Python):
D = int(input())
C = list(map(int, input().split()))
S = []
con= 0
for _ in range(D):
    S.append(list(map(int, input().split())))
t = [-1]*D
best = [0]*D
last = [0]*26

for i in range(D):
    for x in range(26):
        if i==0:
            con = 0
        else:
            con = best[i-1]
        
        con += S[i][x]
        last[x] = i+1
        for j in range(26): 
            con -= C[j]*(i-last[j]+1)
            
        if con>best[i]:
            last[x]=i+1
            best[i]=con
            t[i]=x+1
            

for i in range(D):
  print(t[i])

Solution (Python):
import random
import math
d = int(input())
c = [int(i) for i in input().split()]
s = []
for i in range(d):
    s.append([int(j) for j in input().split()])
t = []

for i in range(d):
    print(math.ceil(26 * random.random()))

Solution (Python):
from random import randint

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

for i in range(1, D+1):
    print(randint(1, 26))

Solution (Python):
d = int(input())
c = [int(i) for i in input().split()]
s = [[int(i) for i in input().split()] for j in range(d)]



ans = []
last = [[0 for i in range(26)] for j in range(27)]
tmp_ans = [0]*26

for i in range(1,d+1):
    tmp_num = 0
    for j in range(26):
        tmp_ans[j] += s[i-1][j]
        last[j+1][j] = i
        for k in range(26):
            tmp_ans[j] -= (i-last[j+1][k])*c[k]
    idx = tmp_ans.index(max(tmp_ans))
    for j in range(26):
        for k in range(26):
            if k == idx:
                continue
            last[k][j] = last[idx][j]
    print(idx+1)
    

    """
            
    ans += s[i-1][t[i-1]-1]
    last[t[i-1]-1] = i
    for j in range(26):
        ans -= (i-last[j])*c[j]
    print(ans)
    """

Solution (Python):
import copy

def calc(T):
    res = 0
    L = [0]*26
    for i in range(D):
        res += S[i][T[i]-1]
        L[T[i]-1] = i+1
        for j in range(26):
            res -= C[j]*(i+1-L[j])
    return res
    
D = int(input())
C = [int(c) for c in input().split()]
S = [[int(s) for s in input().split()] for _ in range(D)]

T = [0]*D
L = [0]*26
for i in range(D):
    p = -10**12
    for j in range(26):
        d = S[i][j]
        for k in range(26):
            if k == j:
                continue
            d -= C[k]*(i+1-L[k])
        if p < d:
            p = d
            idx = j+1
    T[i] = idx
        

p = calc(T)

for i in range(D-1, -1, -1):
    for j in range(26):
        temp = copy.deepcopy(T)
        temp[i] = j+1
        newp = calc(temp)
        if p < newp:
            T[i] = j+1
            p = newp
            
for i in range(D):
    for j in range(26):
        temp = copy.deepcopy(T)
        temp[i] = j+1
        newp = calc(temp)
        if p < newp:
            T[i] = j+1
            p = newp

for t in T:
    print(t)

Solution (Python):
D = int(input())
c = list(map(int, input().split()))
s = [list(map(int, input().split())) for _ in range(D)]
do_list = [-1]*D
for i in range(D):
    tmp, res = s[i][0], 0
    for j in range(1,26):
        if tmp<s[i][j]:
            tmp, res = s[i][j], j
    do_list[i] = res
for i in do_list: print(i+1)

Solution (Python):
def input_one_number():
    return int(input())


D = input_one_number()

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

c = input_multiple_number_as_list()

s = [[]*26 for _ in range(D)]

for i in range(D):
	s[i] = input_multiple_number_as_list()

for day in range(D):
	m = max(s[day])
	print(s[day].index(m)+1)

Solution (Python):
d=int(input())
c=list(map(int,input().split()))
s=[list(map(int,input().split())) for i in range(d)]
for i in range(d):
    cand=0
    for j in range(26):
        if s[i][cand]<s[i][j]:
            cand=j
    print(cand+1)

Solution (Python):
import sys
import random

sys.setrecursionlimit(500000)
def input():
    return sys.stdin.readline()[:-1]

D = int(input())
c = list(map(int,input().split()))
s = [list(map(int,input().split())) for i in range(D)]




def content(t):
    cont = 0
    last = [0]*26
    for i in range(D):
        cont += s[i][t[i]-1]
        last[t[i]-1] = i+1
        for j in range(26):
            cont -= c[j]*(i+1-last[j])
    return cont

def main():
    t = [random.randint(1,26) for i in range(D)]
    prev = content(t)
    for i in range(100):
        d,q = random.randint(0,D-1), random.randint(1,26)
        prev_t = t[d]
        t[d] = q
        now = content(t)
        if prev>content(t):
            t[d] = prev_t
        else:
            prev=now
    for a in t:
        print(a)


if __name__ == '__main__':
    main()

Solution (Python):
import numpy as np

d=int(input())
c=list(map(int,input().split()))
s=[]
for i in range(d):
  s.append(list(map(int,input().split())))

for i in range(d):
  print(np.argmax(s[i])+1)

Solution (Python):
d=int(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=[]


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)

Solution (Python):
D=int(input())
c = list(map(int,input().split()))
s=[[0 for e in range(26)] for f in range(D)]
for i in range(D):
 s[i]=list(map(int,input().split()))
last=[0]*26
ans=0
point=[0]*D
for i in range(D):
 saidai=-(10**10)
 kouho=1
 for j in range(26):
  if s[i][j]+c[j]*((i+1)-last[j])>=saidai:
   kouho=j+1
   saidai=s[i][j]+c[j]*((i+1)-last[j])
 print(1)

Solution (Python):
D=int(input())
clist=list(map(int,input().split()))
smat=[[int(x) for x in input().split()] for _ in range(D)]



max_index_c=-1
max_c=-1
for i in range(26):
  if max_c<clist[i]:
    max_index_c=i+1
    max_c=clist[i]

for d in range(D):
  max_index=-1
  max_sd=-1
  for i in range(26):
    if max_sd<smat[d][i]:
      max_index=i+1
      max_sd=smat[d][i]
      
  if max_index_c==max_index:
    print(max_index)
  else:
    if max_c>max_sd:
      print(max_index_c)
    else:
      print(max_index)

Solution (Python):
import sys
def input():
    return sys.stdin.readline().rstrip()
def main():
    def scoring(ans, d, t, C, S, L, replace = False):
        ans += S[d][t]
        L[t] = d
        ans -= sum([c * (d - l) for (c, l) in zip(C, L)])
        if replace:
            return ans, L
        else:
            return ans
    D = int(input())
    C = list(map(int, input().split()))
    S = [list(map(int, input().split())) for _ in range(D)]
    L = [-1] * 26
    ans = 0
    for d in range(D):
        ANS = [scoring(ans, d, t, C, S, L) for t in range(26)]
        t_max = ANS.index(max(ANS))
        ans, L = scoring(ans, d, t_max, C, S, L, replace = True)
        print(t_max + 1)


if __name__ == '__main__':
    main()

Solution (Python):
import numpy as np

D = int(input())
c = np.array(list(map(int, input().split())))
S = np.array([list(map(int, input().split())) for i in range(D)])

last_day = np.zeros(26, dtype=int)

ans = []
for d in range(1, D+1):
    decrease = c * (d - last_day)
    sd = decrease.sum()
    diff = [S[d-1, i] - sd + decrease[i] for i in range(26)]
    choice = np.argmax(diff)
    ans.append(choice+1)
    last_day[choice] = d


print(*ans, sep='\n')

Solution (Python):
d=int(input())
c=list(map(int,input().split()))
s=[]
for i in range(d):
    t=list(map(int,input().split()))
    s.append(t)

for i in range(d):
    p=max(s[i])
    print(s[i].index(p)+1)

Solution (Python):
for i in range(365):
  print(i%26+1)

Solution (Python):


import sys
read = sys.stdin.read
readline = sys.stdin.readline
import time



D = 365
*c, = map(int,readline().split())
s = tuple(tuple(map(int,readline().split())) for _ in range(D))

def output(ans):
    for i in ans: print(i+1)

def score(ans,s,c): 
    last = [-1]*26
    score = 0
    for i, ai in enumerate(ans):
        score += s[i][ai]
        last[ai] = i
        for ci,li in zip(c,last):
            score -= ci*(i-li)
        
    return score



ans = (list(range(26))*20)[:365]

"""
solution = 初期解(ランダム生成や、貪欲法など他の手法で求めたものを利用)
while 時間のある限り:
    solution を(ランダムに)少し変形
    if 変形前より解が悪化:
        solution を変形前の状態に戻す
"""

def main(ans,s,c):
    start = time.time()
    while time.time() - start < 0.5:
        pass
    return ans



output(main(ans,s,c))

Solution (Python):
D = int(input())
c = list(map(int, input().split()))
s = []
for i in range(D):
  s.append(list(map(int, input().split())))
  
sdictlist = []
sdictlistsorted = []
for i in range(D):
  onedict = {}
  for j in range(26):
    onedict[j] = s[i][j]
  sdictlist.append(onedict)
  onesorteddict = sorted(onedict.items(), key=lambda x:x[1], reverse=True)
  sdictlistsorted.append(onesorteddict)
  



num = 1
for i in range(D):
  print(num)
  if(num == 26):
    num = 1
  elif(num == 25):
    num = 2
  else:
    num += 2

Solution (Python):
import sys
from typing import List, Tuple, Dict
from dataclasses import dataclass, field

import scipy
import numpy as np
from numba import jit

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


@dataclass()
class Node:
    date: int
    value: int
    result: list = field(default_factory=list)

    def __lt__(self, other) -> bool:
        return self.value < other.value

    def output(self) -> str:
        assert len(self.result) == D
        return '\n'.join(self.result)


def calc_satisfaction(plan: List[int]) -> int:
    assert len(plan) == D
    res = 0
    last = np.zeros(26)

    for d in range(D):
        p = plan[d] - 1
        res += S[d][p]
        last[p] = d + 1

        for i in range(26):
            res -= C[i] * (d + 1 - last[i])

    return int(max(10 ** 6 + res, 0))


plan = []
for d in range(D):
    t = 0
    max_s = 0
    for i, s in enumerate(S[d]):
        if s > max_s:
            t = i + 1
            max_s = s

    plan.append(t)

print(plan, file=sys.stderr)
print(calc_satisfaction(plan), file=sys.stderr)
print('\n'.join(map(lambda x: str(x), plan)))

Solution (Python):
import math

import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit


ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    d = int(ipt())
    c = [int(i) for i in ipt().split()]
    s = [[int(i) for i in ipt().split()] for _ in range(d)]
    ld = [-1]*26
    edval = [0]*26

    for i in range(d):
        edval = s[i]*1
        for j in range(26):
            dl = i-ld[j]
            edval[j] += c[j]*dl*(dl+1)//2
        v = edval.index(max(edval))
        ld[v] = i
        print(v+1)

    return

if __name__ == '__main__':
    main()

Solution (Python):
D=int(input())



for i in range(D):
  print(i%26+1)

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


def main():
    D = int(input())
    C = [0] + list(map(int, input().split()))
    S = [[0] * 27]
    for _ in range(D):
        S.append([0] + list(map(int, input().split())))
    T = [0]

    satisfactory = 0
    last = [0] * 27
    for d in range(1, D + 1):
        cand = (-1, -10**18) 
        
        for type in range(1, 27):
            tmp = S[d][type]
            for i in range(1, 27):
                if i == type: continue
                tmp -= C[i] * (d - last[i])
            if tmp > cand[1]:
                cand = (type, tmp)

        
        last[cand[0]] = d
        satisfactory += cand[1]
        T.append(cand[0])

    for i in range(1, D + 1):
        print(T[i])

if __name__ == "__main__":
    main()

Solution (Python):
import sys
input=sys.stdin.readline
from random import seed, randint

def calc(d,C,S,T):
    Last=[0]*26
    score=0
    for day,t in enumerate(T):
        t-=1
        Last[t]=day+1
        score+=S[day][t]
        for i,c in enumerate(C):
            score-=c*(day+1-Last[i])
    return score

def main():
    d=int(input())
    C=tuple(map(int,input().split()))
    S=[tuple(map(int,input().split())) for _ in range(d)]
    T=[(i%26)+1 for i in range(d)]
    score=calc(d,C,S,T)
    Ans=T[:]
    
    m=10000
    for i in range(m):
        seed(i)
        d_idx=randint(0,d-1)
        q=randint(1,26)
        
        T[d_idx]=q
        tmp=calc(d,C,S,T)
        if tmp>score:
            score=tmp
            Ans=T[:]
    
    print(*Ans,sep='\n')
    
if __name__=='__main__':
    main()

Solution (Python):
import random

global NN
NN = 26


class Contest:
    """
    d: ある日付
    i: テストの種類
    self.day: 最後にテストiを開催した日
    """

    def __init__(self, c, s, D):
        self.test = [i % NN for i in range(D)]
        self.last = [0 for _ in range(NN)]
        self.C = c
        self.S = s
        self.score = 0

    def update_day(self, i, d):
        self.last[i] = d

    def minus_score(self, d, i):
        m = self.C[i] * (d - self.last[i])
        return m

    def sum_minus_scores(self, d):
        m = 0
        for i in range(NN):
            m += self.minus_score(d, i)

        return m

    
    def update_score(self, i, d):
        s = self.score
        self.update_day(i, d)
        s += S[d][i]
        s -= self.sum_minus_scores(d)
        return s


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

r = [random.randrange(1, NN + 1) for _ in range(D)]
print(*r)


















"""
+ 方針
  + Cの大きいテストは定期的に開催する
  + Cの小さいテストはまれに開催する
    + d = 1, 2, 3, 4, 5 ....
    + d-last[d] = 1, 3, 6, 10, 15 ...
    + 結構緩やか？

+ スコアを伸ばす方法
  + プラスを大きくする
  + マイナスを小さくする

"""

Solution (Python):
d = int(input())
c_l = list(map(int,input().split()))
s_l = [list(map(int,input().split())) for i in range(d)]

last_l = [-1 for i in range(26)]

def calc_score(contest_num):
  contest_val = s_l[day][contest_num]
  point = contest_val

  temp_last_l = last_l[:]
  temp_last_l[contest_num] = day

  for i in range(26):
    point -= c_l[i] * (day - temp_last_l[i])

  return point

ans = []

point = 0
for day in range(d):
  each_point = 0
  each_contest_num = 0
  for temp_contest_num in range(26):
    temp_point = calc_score(temp_contest_num)
    if temp_point > each_point:
      each_point = temp_point
      each_contest_num = temp_contest_num

  ans.append(each_contest_num + 1)

for i in ans:
  print(i)

Solution (Python):
import random
for i in range(365):
    print(random.randint(1,26))

Solution (Python):

D=int(input())
c=[]
c=list(map(int,input().split()))
s=[]
for i in range(D):
    s.append(list(map(int,input().split())))

for i in range(D):
    mamax=max(s[i])
    ans=s[i].index(mamax)+1
    print(ans)

Solution (Python):
for i in range(365):
  print(15)

Solution (Python):
import sys
input = sys.stdin.readline
import numpy as np
from numba import njit


def read():
    D = int(input().strip())
    C = np.fromstring(input().strip(), dtype=np.int32, sep=" ")
    S = np.empty((D, 26), dtype=np.int32)
    for i in range(D):
        s = np.fromstring(input().strip(), dtype=np.int32, sep=" ")
        S[i, :] = s[:]
    return D, C, S


@njit
def solve(D, C, S):
    last = [-1 for i in range(26)]
    idx = np.argmax(C)
    for d in range(D):
        print(idx+1)


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Solution (Python):
import random
d = int(input())
c = list(map(int, input().split()))
s = []
for i in range(d):
  s.append(list(map(int, input().split())))
for i in range(d):
  print(random.randrange(1,27))

Solution (Python):
def resolve():
    import copy
    D = int(input())
    cost = list(map(int, input().split()))
    sat = [list((map(int, input().split()))) for _ in range(D)]
    last = [0]*26
    
    for i in range(D):
        maxcost = 0
        ans = 0
        
        for j in range(26):
            nowlast = copy.deepcopy(last)
            nowlast[j] = i+1
            plussat = sat[i][j]
            minussat = 0
            for k in range(26):
                minussat += (i + 1 - nowlast[k]) * (cost[k])
            cum = plussat-minussat
            
            if maxcost < cum:
                ans = j
                maxcost = cum

        print(ans+1)
resolve()

Solution (Python):
import numpy as np
d=int(input())
c=list(map(int,input().split()))
TotalLoss=sum(c)
for i in range(26):
  c[i]=TotalLoss-c[i]
c=np.array(c)
s=[]
for i in range(d):
  si=list(map(int,input().split()))
  s.append(si)
s=np.array(s)
ans=[]
for i in range(d):
  si=s[i]
  si-=c
  index=np.argmax(si)
  ans.append(index+1)
for i in range(d):
  print(ans[i])

Solution (Python):
d=int(input())
c=list(map(int,input().split()))
s=[list(map(int,input().split())) for _ in range(d)]
score=0
prev=0
se=set()
for i in range(d):
    lis=[]
    if i//26>prev:
        se=set()
        prev=i//26
    for j in range(26):
        lis.append((s[i][j]-c[j],j))
    lis.sort(reverse=True)
    for j in range(26):
        if lis[j][1] not in se:
            se.add(lis[j][1])
            print(lis[j][1]+1)
            break

Solution (Python):
d=int(input())
for i in range(d):
  print(i%26+1
       )

Solution (Python):
D=int(input())
c=list(map(int,input().split()))
s=[list(map(int,input().split())) for i in range(D)]
last=[0 for i in range(26)]
def evaluate(nowmanzoku,k,d):
    tmp=[last[i] for i in range(26)]
    tmp[k]=d+1
    manzokudo=nowmanzoku+s[d][k]
    for i in range(26):
        manzokudo-=c[i]*(d+1-tmp[i])
    return manzokudo
nmanzoku=0
for day in range(D):
    k=0
    maxmanzoku=-10**30
    for j in range(26):
        tmp=evaluate(nmanzoku,j,day)
        if maxmanzoku<tmp:
            maxmanzoku=tmp
            k=j
    print(k+1)
    nmanzoku=evaluate(nmanzoku,k,day)

Solution (Python):
D=int(input())
C=list(map(int,input().split()))
S=[list(map(int,input().split())) for i in range(D)]
l=[0]*26
for d in range(D):
    x=[S[d][i]-sum([(d+1-l[j])*C[j] for j in range(26) if i!=j]) for i in range(26)]
    j=x.index(max(x))
    l[j]=d+1
    print(j+1)

Solution (Python):
d = int(input())
clst = list(map(int, input().split()))
s = [list(map(int, input().split())) for _ in range(d)]
last = [0 for _ in range(26)]

def score_minus(d, q):
    minus = 0
    for c, ls in zip(clst, last):
        minus += c * (d - ls)
    minus -= clst[q] * (d - last[q])
    return minus
    
ans = 0
for i in range(d):
    tmp = 0
    for q in range(26):
        tmp_score = s[i][q] - score_minus(i, q)
        if tmp_score > tmp:
            tmp = tmp_score
            max_q = q
    print(max_q + 1)
    last[max_q] = i

Solution (Python):
import random
D = int(input())
C = list(map(int, input().split()))
S = [list(map(int, input().split())) for _ in range(D)]
for i in range(D):
    print(S[i].index(max(S[i]))+1)

Solution (Python):
import numpy as np

D = int(input())
c = np.array(list(map(int,input().split())))
s = np.array([list(map(int,input().split())) for _ in range(D)])

last = np.zeros(26,int)

score = 0

for i in range(D):
    
    last += 1
    each_s_minus = c*last
    
    score -= each_s_minus.sum()
    
    each_score = s[i,:] + each_s_minus
    
    t = np.argmax(each_score)
    
    score += each_score[t]
    
    last[t] = 0
    
    print(t+1)

Solution (Python):
d = int(input())
c = list(map(int, input().split()))
s = [list(map(int, input().split())) for _ in range(d)]
x = [0] * 26
for _ in range(d):
    for i in range(26):
        x[i] += c[i]
    y = x.index(max(x))
    print(y + 1)
    x[y] = 0

Solution (Python):
D = int(input())
C = [int(i) for i in input().split()]
S = [[int(i) for i in input().split()] for j in range(D)]

total = 0
last = [0] * 26
ans = []
for i in range(1, D+1):
    score = [0] * 26
    for t in range(26):
        score[t] += S[i-1][t-1]
        for j in range(26):
            if j != t:
                score[t] -= C[j] * (i - last[j])
    total += max(score)
    last[score.index(max(score))] = i
    ans.append(score.index(max(score))+1)

for i in range(D):
    print(ans[i])

Solution (Python):
def main():
    D = int(input())
    C = list(map(int, input().split()))
    S = [list(map(int, input().split())) for _ in range(D)]

    score = 0
    last_day = [-1] * 26
    ans = [1] * D
    print(*ans, sep="\n")


if __name__ == '__main__':
    main()

Solution (Python):
import random

D,*CS = map(int, open(0).read().split())
C = CS[:26]
S = [CS[26*i:26*(i+1)] for i in range(1, D+1)]

def imax(xs):
    m = -1
    i = 0
    for j, x in enumerate(xs):
        if x > m:
            i = j
            m = x
    return i

for d in range(D):
    i = imax(S[d])
    i = random.randint(0, 25)
    print(i + 1)

Solution (Python):
d = int(input())
c = list(map(int, input().split()))
s = [list(map(int, input().split())) for _ in range(d)]
k = [-1] * 26
for i in range(d):
    res = -100000000
    p = 0
    for j in range(26):
        tmp = 0
        tmp += s[i][j]
        for x in range(26):
            if x == j:
                continue
            tmp -= c[x] * (i - k[x])
        if res < tmp:
            res = tmp
            p = j
    k[p] = i
    print(p + 1)

Solution (Python):
import random
D = int(input())
c = list(map(int, input().split()))
s = []
for i in range(D):
  S = list(map(int, input().split()))
  s.append(S)
  
for i in range(D):
  ans = random.randint(1, 26)
  print(ans)

Solution (Python):
d = int(input())

lc = list(map(int, input().split()))

for i in range(d):
    ls = list(map(int, input().split()))
    print(ls.index(max(ls))+1)

Solution (Python):
d=int(input())

last=[0]*26
c=list(map(int,input().split()))
s=[list(map(int, input().split())) for _ in range(d)]

ans=[]

for i in range(d):

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

    score=-1*(10**9)
    kouho=0
    for j in range(26):
        if score<s[i][j]-down+c[j]*((i+1)-last[j]):
            score=s[i][j]-down+c[j]*((i+1)-last[j])
            kouho=j+1
    ans.append(kouho)
    last[kouho-1]=i+1

for item in ans:
    print(item)

Solution (Python):


import sys
from copy import deepcopy
input=sys.stdin.readline

def main():
    D=int(input())
    C=list(map(int,input().split()))
    S=[list(map(int,input().split())) for i in range(D)]
    last=[[0]*27 for i in range(D+1)]
    for day in range(1,D+1):
        lastt=deepcopy(last)
        maxt=0
        maxx=0
        for t in range(1,27):
            sat=0
            for j in range(day,D+1):
                    last[j][t]=day
            sat+=S[day-1][t-1]
            for j in range(1,27):
                sat-=C[j-1]*(day-last[day][j])
            if maxx<sat:
                maxt=t
                maxx=sat
        last=deepcopy(lastt)
        for j in range(day,D+1):
            last[j][maxt]=day
        print(maxt)
    
if __name__=="__main__":
    main()

Solution (Python):
def is_valid(ans_types: list, ans_val: int) -> bool:
    """ans_types(1-indexed)を選んだときに、
    答えがans_valになるかどうかを確かめる。"""
    res = 0

    tmp_last_days = {}
    for c_type in range(C_TYPES):
        tmp_last_days[c_type] = 0
   
    for day in range(1, DAYS + 1):
        c_type = ans_types[day - 1] - 1
        res += s[day][c_type]

        tmp_last_days[c_type] = day
        for c_type in range(C_TYPES):
            res -= c[c_type] * (day - tmp_last_days[c_type])

    return res == ans_val

def search_max_point(day: int, last_days: dict):
    """day-1日目までに選んだコンテストが確定している状態で
    day日目にどのコンテストを選べば満足度を最適化できるか貪欲に探索する。
    dayは1-indexedに注意。
    返値として、選ぶコンテスト(0-indexed)、そのときに得られる満足度を返す。
    """
    max_val = -INF
    max_type = -1
    for c_type in range(C_TYPES):
        tmp = s[day][c_type]
        for c_type2 in range(C_TYPES):
            if c_type2 == c_type:
                continue
            tmp -= c[c_type2] * (day - last_days[c_type2])
        if max_val < tmp:
            max_val = tmp
            max_type = c_type
    return max_type, max_val


d = int(input())  
c = list(map(int, input().split()))
s = [[0 for i in range(26)]] + [list(map(int, input().split())) for i in range(d)]
DAYS = d
C_TYPES = 26
INF = 10 ** 18



last_days = {}
for c_type in range(C_TYPES):
    last_days[c_type] = 0

ans_val = 0
ans_types = []
for day in range(1, DAYS + 1):
    c_type, val = search_max_point(day, last_days)
    ans_types.append(c_type + 1)
    ans_val += val
    last_days[c_type] = day


if not is_valid(ans_types, ans_val):
    print(re)
    exit()
    
for t in ans_types:
    print(t)