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 time import time
start=time()
from copy import deepcopy
from random import randint

d=int(input())
c=list(map(int,input().split())) 
s=[] 
for i in range(d):
    t=list(map(int,input().split()))
    s.append(t)
last=[0]*26 
ans_lst=[]

for i in range(1,d): 
    temp_best=-100000000
    for j in range(26): 
        temp=s[i-1][j]
        for k in range(26): 
            if j!=k:
                temp-=(c[k]*(i-last[k]))
        temp_last=deepcopy(last)
        temp_last[j]=i
        for k in range(26):
            temp+=s[i][k]
            for l in range(26):
                if k!=l:
                    temp-=(c[l]*(i+1-temp_last[l]))
        if temp>temp_best:
            temp_best=temp
            rem=j
    ans_lst.append(rem)
    last[rem]=i
    
temp_best=-100000000 
for j in range(26): 
    temp=s[i-1][j]
    for k in range(26): 
        if j!=k:
            temp-=(c[k]*(i-last[k]))
    if temp>temp_best:
        temp_best=temp
        rem=j
ans_lst.append(rem) 

score=0
las=[0]*26
for i in range(d):
    for j in range(26):
        las[j]+=1
    score+=s[i][ans_lst[i]]
    las[ans_lst[i]]=0
    for j in range(26):
        score-=c[j]*las[j]

for q in range(1,26):
    for p in range(d-q):
        las=[0]*26
        temp_score=0
        temp_ans_lst=deepcopy(ans_lst)
        temp_ans_lst[p],temp_ans_lst[p+q]=temp_ans_lst[p+q],temp_ans_lst[p]
        for i in range(d):
            for j in range(26):
                las[j]+=1
            temp_score+=s[i][temp_ans_lst[i]]
            las[temp_ans_lst[i]]=0
            for j in range(26):
                temp_score-=c[j]*las[j]
        if temp_score>score:
            score=temp_score
            ans_lst=temp_ans_lst

while time()-start<1.9:
    las=[0]*26
    temp_score=0
    temp_ans_lst=deepcopy(ans_lst)
    a=randint(0,d-2)
    b=randint(0,d-2)
    temp_ans_lst[a],temp_ans_lst[a+1]=temp_ans_lst[a+1],temp_ans_lst[a]
    temp_ans_lst[b],temp_ans_lst[b+1]=temp_ans_lst[b+1],temp_ans_lst[b]
    for i in range(d):
        for j in range(26):
            las[j]+=1
        temp_score+=s[i][temp_ans_lst[i]]
        las[temp_ans_lst[i]]=0
        for j in range(26):
            temp_score-=c[j]*las[j]
    if temp_score>score:
        score=temp_score
        ans_lst=temp_ans_lst

for i in ans_lst:
    print(i+1)

Solution (Python):
D = int(input())
c = [int(i) for i in input().split()]
s = [[int(i) for i in input().split()] for _ in range(D)]
res = 0
ans = [-1]*D
llst = [0]*26

def calc(d,x):
    day = d+1
    res = s[d][x]
    for i in range(26):
        if x == i: continue
        res -= c[i]*(day-llst[i])
    return res

for i in range(D):
    mx = -1
    mxv = -float("inf")
    for j in range(26):
        v = calc(i,j)
        if v >= mxv:
            mx = j
            mxv = v
    ans[i] = mx+1
    llst[mx] = i+1
for i in range(D): print(ans[i])

Solution (Python):
D=int(input())
C=list(map(int,input().split()))
import numpy as np
L=np.zeros(26,dtype=np.int)
ans=[]
for d in range(D):
  L+=1
  X=L*C
  xi=X.argmax()
  S=list(map(int,input().split()))
  si=np.argmax(S)
  if si==xi:
    ans.append(si+1)
    L[si]=0
  elif S[si]-5*C[xi]>X[xi]:
    ans.append(si+1)
    L[si]=0
  else:
    ans.append(xi+1)
    L[xi]=0
for a in ans:
  print(a)

Solution (Python):
from time import time
start=time()
from copy import deepcopy
from random import randint

d=int(input())
c=list(map(int,input().split())) 
s=[] 
for i in range(d):
    t=list(map(int,input().split()))
    s.append(t)
last=[0]*26 
ans_lst=[]

for i in range(1,d): 
    temp_best=-100000000
    for j in range(26): 
        temp=s[i-1][j]
        for k in range(26): 
            if j!=k:
                temp-=(c[k]*(i-last[k]))
        temp_last=deepcopy(last)
        temp_last[j]=i
        for k in range(26):
            temp+=s[i][k]
            for l in range(26):
                if k!=l:
                    temp-=(c[l]*(i+1-temp_last[l]))
        if temp>temp_best:
            temp_best=temp
            rem=j
    ans_lst.append(rem)
    last[rem]=i
    
temp_best=-100000000 
for j in range(26): 
    temp=s[i-1][j]
    for k in range(26): 
        if j!=k:
            temp-=(c[k]*(i-last[k]))
    if temp>temp_best:
        temp_best=temp
        rem=j
ans_lst.append(rem) 

score=0
las=[0]*26
for i in range(d):
    for j in range(26):
        las[j]+=1
    score+=s[i][ans_lst[i]]
    las[ans_lst[i]]=0
    for j in range(26):
        score-=c[j]*las[j]

for q in range(1,25):
    for p in range(d-q):
        las=[0]*26
        temp_score=0
        temp_ans_lst=deepcopy(ans_lst)
        temp_ans_lst[p],temp_ans_lst[p+q]=temp_ans_lst[p+q],temp_ans_lst[p]
        for i in range(d):
            for j in range(26):
                las[j]+=1
            temp_score+=s[i][temp_ans_lst[i]]
            las[temp_ans_lst[i]]=0
            for j in range(26):
                temp_score-=c[j]*las[j]
        if temp_score>score:
            score=temp_score
            ans_lst=temp_ans_lst

while time()-start<1.9:
    las=[0]*26
    temp_score=0
    temp_ans_lst=deepcopy(ans_lst)
    a=randint(0,d-2)
    b=randint(0,d-2)
    temp_ans_lst[a],temp_ans_lst[a+1]=temp_ans_lst[a+1],temp_ans_lst[a]
    temp_ans_lst[b],temp_ans_lst[b+1]=temp_ans_lst[b+1],temp_ans_lst[b]
    for i in range(d):
        for j in range(26):
            las[j]+=1
        temp_score+=s[i][temp_ans_lst[i]]
        las[temp_ans_lst[i]]=0
        for j in range(26):
            temp_score-=c[j]*las[j]
    if temp_score>score:
        score=temp_score
        ans_lst=temp_ans_lst

for i in ans_lst:
    print(i+1)

Solution (Python):
D = int(input())
c = [int(i) for i in input().split()]
s = [[int(i) for i in input().split()] for _ in range(D)]
res = 0
ans = [-1]*D
llst = [0]*26

def calc(d,x):
    day = d+1
    res = s[d][x]
    for i in range(26):
        if x == i: continue
        res -= c[i]*(day-llst[i])
    return res

for i in range(D):
    mx = -1
    mxv = -float("inf")
    for j in range(26):
        v = calc(i,j)
        if v >= mxv:
            mx = j
            mxv = v
    ans[i] = mx+1
for i in range(D): print(ans[i])

Solution (Python):
from time import time
start=time()
from copy import deepcopy
from random import randint

d=int(input())
c=list(map(int,input().split())) 
s=[] 
for i in range(d):
    t=list(map(int,input().split()))
    s.append(t)
last=[0]*26 
ans_lst=[]

for i in range(1,d): 
    temp_best=-100000000
    for j in range(26): 
        temp=s[i-1][j]
        for k in range(26): 
            if j!=k:
                temp-=(c[k]*(i-last[k]))
        temp_last=deepcopy(last)
        temp_last[j]=i
        for k in range(26):
            temp+=s[i][k]
            for l in range(26):
                if k!=l:
                    temp-=(c[l]*(i+1-temp_last[l]))
        if temp>temp_best:
            temp_best=temp
            rem=j
    ans_lst.append(rem)
    last[rem]=i
    
temp_best=-100000000 
for j in range(26): 
    temp=s[i-1][j]
    for k in range(26): 
        if j!=k:
            temp-=(c[k]*(i-last[k]))
    if temp>temp_best:
        temp_best=temp
        rem=j
ans_lst.append(rem) 

score=0
las=[0]*26
for i in range(d):
    for j in range(26):
        las[j]+=1
    score+=s[i][ans_lst[i]]
    las[ans_lst[i]]=0
    for j in range(26):
        score-=c[j]*las[j]

for q in range(1,15):
    for p in range(d-q):
        las=[0]*26
        temp_score=0
        temp_ans_lst=deepcopy(ans_lst)
        temp_ans_lst[p],temp_ans_lst[p+q]=temp_ans_lst[p+q],temp_ans_lst[p]
        for i in range(d):
            for j in range(26):
                las[j]+=1
            temp_score+=s[i][temp_ans_lst[i]]
            las[temp_ans_lst[i]]=0
            for j in range(26):
                temp_score-=c[j]*las[j]
        if temp_score>score:
            score=temp_score
            ans_lst=temp_ans_lst

while time()-start<1.9:
    las=[0]*26
    temp_score=0
    temp_ans_lst=deepcopy(ans_lst)
    a=randint(0,d-2)
    b=randint(0,d-2)
    temp_ans_lst[a],temp_ans_lst[a+1]=temp_ans_lst[a+1],temp_ans_lst[a]
    temp_ans_lst[b],temp_ans_lst[b+1]=temp_ans_lst[b+1],temp_ans_lst[b]
    for i in range(d):
        for j in range(26):
            las[j]+=1
        temp_score+=s[i][temp_ans_lst[i]]
        las[temp_ans_lst[i]]=0
        for j in range(26):
            temp_score-=c[j]*las[j]
    if temp_score>score:
        score=temp_score
        ans_lst=temp_ans_lst

for i in ans_lst:
    print(i+1)

Solution (Python):
D=int(input())
C=list(map(int,input().split()))
import numpy as np
L=np.zeros(26,dtype=np.int)
ans=[]
for d in range(D):
  L+=1
  X=L*C
  xi=X.argmax()
  S=list(map(int,input().split()))
  si=np.argmax(S)
  if si==xi:
    ans.append(si+1)
    L[si]=0
  elif S[si]-C[xi]>X[xi]:
    ans.append(si+1)
    L[si]=0
  else:
    ans.append(xi+1)
    L[xi]=0
for a in ans:
  print(a)

Solution (Python):
from time import time
start=time()
from copy import deepcopy
from random import randint

d=int(input())
c=list(map(int,input().split())) 
s=[] 
for i in range(d):
    t=list(map(int,input().split()))
    s.append(t)
last=[0]*26 
ans_lst=[]

for i in range(1,d): 
    temp_best=-100000000
    for j in range(26): 
        temp=s[i-1][j]
        for k in range(26): 
            if j!=k:
                temp-=(c[k]*(i-last[k]))
        temp_last=deepcopy(last)
        temp_last[j]=i
        for k in range(26):
            temp+=s[i][k]
            for l in range(26):
                if k!=l:
                    temp-=(c[l]*(i+1-temp_last[l]))
        if temp>temp_best:
            temp_best=temp
            rem=j
    ans_lst.append(rem)
    last[rem]=i
    
temp_best=-100000000 
for j in range(26): 
    temp=s[i-1][j]
    for k in range(26): 
        if j!=k:
            temp-=(c[k]*(i-last[k]))
    if temp>temp_best:
        temp_best=temp
        rem=j
ans_lst.append(rem) 

score=0
las=[0]*26
for i in range(d):
    for j in range(26):
        las[j]+=1
    score+=s[i][ans_lst[i]]
    las[ans_lst[i]]=0
    for j in range(26):
        score-=c[j]*las[j]

for q in range(1,10):
    for p in range(d-q):
        las=[0]*26
        temp_score=0
        temp_ans_lst=deepcopy(ans_lst)
        temp_ans_lst[p],temp_ans_lst[p+q]=temp_ans_lst[p+q],temp_ans_lst[p]
        for i in range(d):
            for j in range(26):
                las[j]+=1
            temp_score+=s[i][temp_ans_lst[i]]
            las[temp_ans_lst[i]]=0
            for j in range(26):
                temp_score-=c[j]*las[j]
        if temp_score>score:
            score=temp_score
            ans_lst=temp_ans_lst

while time()-start<1.9:
    las=[0]*26
    temp_score=0
    temp_ans_lst=deepcopy(ans_lst)
    a=randint(0,d-2)
    b=randint(0,d-2)
    temp_ans_lst[a],temp_ans_lst[a+1]=temp_ans_lst[a+1],temp_ans_lst[a]
    temp_ans_lst[b],temp_ans_lst[b+1]=temp_ans_lst[b+1],temp_ans_lst[b]
    for i in range(d):
        for j in range(26):
            las[j]+=1
        temp_score+=s[i][temp_ans_lst[i]]
        las[temp_ans_lst[i]]=0
        for j in range(26):
            temp_score-=c[j]*las[j]
    if temp_score>score:
        score=temp_score
        ans_lst=temp_ans_lst

for i in ans_lst:
    print(i+1)

Solution (Python):
from time import time
start=time()
from copy import deepcopy
from random import randint

d=int(input())
c=list(map(int,input().split())) 
s=[] 
for i in range(d):
    t=list(map(int,input().split()))
    s.append(t)
last=[0]*26 
ans_lst=[]

for i in range(1,d): 
    temp_best=-100000000
    for j in range(26): 
        temp=s[i-1][j]
        for k in range(26): 
            if j!=k:
                temp-=(c[k]*(i-last[k]))
        temp_last=deepcopy(last)
        temp_last[j]=i
        for k in range(26):
            temp+=s[i][k]
            for l in range(26):
                if k!=l:
                    temp-=(c[l]*(i+1-temp_last[l]))
        if temp>temp_best:
            temp_best=temp
            rem=j
    ans_lst.append(rem)
    last[rem]=i
    
temp_best=-100000000 
for j in range(26): 
    temp=s[i-1][j]
    for k in range(26): 
        if j!=k:
            temp-=(c[k]*(i-last[k]))
    if temp>temp_best:
        temp_best=temp
        rem=j
ans_lst.append(rem) 

score=0
las=[0]*26
for i in range(d):
    for j in range(26):
        las[j]+=1
    score+=s[i][ans_lst[i]]
    las[ans_lst[i]]=0
    for j in range(26):
        score-=c[j]*las[j]

for q in range(1,13):
    for p in range(d-q):
        las=[0]*26
        temp_score=0
        temp_ans_lst=deepcopy(ans_lst)
        temp_ans_lst[p],temp_ans_lst[p+q]=temp_ans_lst[p+q],temp_ans_lst[p]
        for i in range(d):
            for j in range(26):
                las[j]+=1
            temp_score+=s[i][temp_ans_lst[i]]
            las[temp_ans_lst[i]]=0
            for j in range(26):
                temp_score-=c[j]*las[j]
        if temp_score>score:
            score=temp_score
            ans_lst=temp_ans_lst

while time()-start<1.9:
    las=[0]*26
    temp_score=0
    temp_ans_lst=deepcopy(ans_lst)
    a=randint(0,d-2)
    b=randint(0,d-2)
    temp_ans_lst[a],temp_ans_lst[a+1]=temp_ans_lst[a+1],temp_ans_lst[a]
    temp_ans_lst[b],temp_ans_lst[b+1]=temp_ans_lst[b+1],temp_ans_lst[b]
    for i in range(d):
        for j in range(26):
            las[j]+=1
        temp_score+=s[i][temp_ans_lst[i]]
        las[temp_ans_lst[i]]=0
        for j in range(26):
            temp_score-=c[j]*las[j]
    if temp_score>score:
        score=temp_score
        ans_lst=temp_ans_lst

for i in ans_lst:
    print(i+1)

Solution (Python):
D = int(input())
c = list(map(int,input().split()))
s = [list(map(int,input().split())) for k in range(D)]

ans = []
last = [0]*26
ret = 0
for d in range(D):
    score = -100000000
    t = -1
    for p in range(26):
        prev = last[p]
        last[p] = d+1
        temp = s[d][p]
        for i in range(26):
            temp -= c[i]*(d+1-last[i])
        if temp > score:
            score = temp
            t = p
        last[p] = prev
    last[t] = d+1
    ans.append(t+1)
    ret += score
print(*ans,sep="\n")

Solution (Python):
D = int(input())
c = list(map(int,input().split()))
s = [list(map(int,input().split())) for k in range(D)]

ans = []
last = [0]*26

for d in range(D):
    score = -100000000
    t = -1
    for p in range(26):
        prev = last[p]
        last[p] = d+1
        temp = s[d][p]
        for i in range(26):
            temp -= c[i]*(d+1-last[i])
        if temp > score:
            score = temp
            t = p
        last[p] = prev
    ans.append(t+1)

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

Solution (Python):


import numpy as np
d= int(input())

C = list(map(int,input().split()))
CB = [0 for i in range(len(C))]

c = sum(C)

total = 0


L = []

for i in range(d):
    L.append(list(map(int,input().split())))






def cnt(CB,t):
    for i in range(len(CB)):
        if i != t:
            CB[i] += 1
        else:
            CB[i] = 0
    
    return CB

def sumA(C,CB):
    a = 0
    for i in range(len(CB)):
        a += CB[i]*C[i]
    return a

for i in range(d):
    ind = np.argmax(L[i])
    CB = cnt(CB,ind)
    total += L[i][ind] - sumA(C,CB)
    print(ind+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 s:
    print(i.index(max(i)) + 1)

Solution (Python):
from time import time
start=time()
from copy import deepcopy

d=int(input())
c=list(map(int,input().split())) 
s=[] 
for i in range(d):
    t=list(map(int,input().split()))
    s.append(t)
last=[0]*26 
ans_lst=[]

for i in range(1,d): 
    temp_best=-100000000
    for j in range(26): 
        temp=s[i-1][j]
        for k in range(26): 
            if j!=k:
                temp-=(c[k]*(i-last[k]))
        temp_last=deepcopy(last)
        temp_last[j]=i
        for k in range(26):
            temp+=s[i][k]
            for l in range(26):
                if k!=l:
                    temp-=(c[l]*(i+1-temp_last[l]))
        if temp>temp_best:
            temp_best=temp
            rem=j
    ans_lst.append(rem)
    last[rem]=i
    
temp_best=-100000000 
for j in range(26): 
    temp=s[i-1][j]
    for k in range(26): 
        if j!=k:
            temp-=(c[k]*(i-last[k]))
    if temp>temp_best:
        temp_best=temp
        rem=j
ans_lst.append(rem) 

score=0
las=[0]*26
for i in range(d):
    for j in range(26):
        las[j]+=1
    score+=s[i][ans_lst[i]]
    las[ans_lst[i]]=0
    for j in range(26):
        score-=c[j]*las[j]

for q in range(1,21):
    for p in range(d-q):
        las=[0]*26
        temp_score=0
        temp_ans_lst=deepcopy(ans_lst)
        temp_ans_lst[p],temp_ans_lst[p+q]=temp_ans_lst[p+q],temp_ans_lst[p]
        for i in range(d):
            for j in range(26):
                las[j]+=1
            temp_score+=s[i][temp_ans_lst[i]]
            las[temp_ans_lst[i]]=0
            for j in range(26):
                temp_score-=c[j]*las[j]
        if temp_score>score:
            score=temp_score
            ans_lst=temp_ans_lst

for i in ans_lst:
    print(i+1)

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(26)]

for i in range(1,d+1):
    tmp_ans = [0]*26
    for j in range(26):
        tmp_ans[j] += s[i-1][j]
        last[j][j] = i
        for k in range(26):
            tmp_ans[j] -= (i-last[j][k])*c[k]
    idx = tmp_ans.index(max(tmp_ans))
    for j in range(26):
        for k in range(26):
            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):
from time import time
start=time()
from copy import deepcopy
from random import randint

d=int(input())
c=list(map(int,input().split())) 
s=[] 
for i in range(d):
    t=list(map(int,input().split()))
    s.append(t)
last=[0]*26 
ans_lst=[]

for i in range(1,d): 
    temp_best=-100000000
    for j in range(26): 
        temp=s[i-1][j]
        for k in range(26): 
            if j!=k:
                temp-=(c[k]*(i-last[k]))
        temp_last=deepcopy(last)
        temp_last[j]=i
        for k in range(26):
            temp+=s[i][k]
            for l in range(26):
                if k!=l:
                    temp-=(c[l]*(i+1-temp_last[l]))
        if temp>temp_best:
            temp_best=temp
            rem=j
    ans_lst.append(rem)
    last[rem]=i
    
temp_best=-100000000 
for j in range(26): 
    temp=s[i-1][j]
    for k in range(26): 
        if j!=k:
            temp-=(c[k]*(i-last[k]))
    if temp>temp_best:
        temp_best=temp
        rem=j
ans_lst.append(rem) 

score=0
las=[0]*26
for i in range(d):
    for j in range(26):
        las[j]+=1
    score+=s[i][ans_lst[i]]
    las[ans_lst[i]]=0
    for j in range(26):
        score-=c[j]*las[j]

while time()-start<1.9:
    las=[0]*26
    temp_score=0
    temp_ans_lst=deepcopy(ans_lst)
    a=randint(0,d-2)
    b=randint(0,d-2)
    temp_ans_lst[a],temp_ans_lst[a+1]=temp_ans_lst[a+1],temp_ans_lst[a]
    temp_ans_lst[b],temp_ans_lst[b+1]=temp_ans_lst[b+1],temp_ans_lst[b]
    for i in range(d):
        for j in range(26):
            las[j]+=1
        temp_score+=s[i][temp_ans_lst[i]]
        las[temp_ans_lst[i]]=0
        for j in range(26):
            temp_score-=c[j]*las[j]
    if temp_score>score:
        score=temp_score
        ans_lst=temp_ans_lst

for i in ans_lst:
    print(i+1)

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)]

for i in range(1,d+1):
    tmp_ans = [0]*26
    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):
d = int(input())
c = list(map(int, input().split()))
s = []
lastDays = [0]*26

for _ in range(d):
  s.append(list(map(int, input().split())))

for i in range(d):
  kouho = 1
  kouhoHyouka = -999999999999
  for j in range(26):
    if s[i][j] - c[j] * (i + 1 - lastDays[j]) > kouhoHyouka:
      kouho = j
      kouhoHyouka = s[i][j] - c[j] * (i + 1 - lastDays[j])
  lastDays[j] = i+1
  print(kouho+1)

Solution (Python):
d = int(input())
c = list(map(int, input().split()))
s = []
lastDays = [0]*26

for _ in range(d):
  s.append(list(map(int, input().split())))

for i in range(d):
  kouho = 0
  kouhoHyouka = -999999999999
  for j in range(26):
    if s[i][j] - c[j] * (i + 1 - lastDays[j]) > kouhoHyouka:
      kouho = j
      kouhoHyouka = s[i][j] - c[j] * (i + 1 - lastDays[j])
  lastDays[j] = i+1
  print(kouho+1)

Solution (Python):
from copy import deepcopy

d=int(input())
c=list(map(int,input().split())) 
s=[] 
for i in range(d):
    t=list(map(int,input().split()))
    s.append(t)
last=[0]*26 
ans_lst=[]

for i in range(1,d): 
    temp_best=-100000000
    for j in range(26): 
        temp=s[i-1][j]
        for k in range(26): 
            if j!=k:
                temp-=(c[k]*(i-last[k]))
        temp_last=deepcopy(last)
        temp_last[j]=i
        for k in range(26):
            temp+=s[i][k]
            for l in range(26):
                if k!=l:
                    temp-=(c[l]*(i+1-temp_last[l]))
        if temp>temp_best:
            temp_best=temp
            rem=j
    ans_lst.append(rem)
    last[rem]=i
    
temp_best=-100000000 
for j in range(26): 
    temp=s[i-1][j]
    for k in range(26): 
        if j!=k:
            temp-=(c[k]*(i-last[k]))
    if temp>temp_best:
        temp_best=temp
        rem=j
ans_lst.append(rem) 

score=0
las=[0]*26
for i in range(d):
    for j in range(26):
        las[j]+=1
    score+=s[i][ans_lst[i]]
    las[ans_lst[i]]=0
    for j in range(26):
        score-=c[j]*las[j]

for q in range(1,61):
    for p in range(d-q):
        las=[0]*26
        temp_score=0
        temp_ans_lst=deepcopy(ans_lst)
        temp_ans_lst[p],temp_ans_lst[p+q]=temp_ans_lst[p+q],temp_ans_lst[p]
        for i in range(d):
            for j in range(26):
                las[j]+=1
            temp_score+=s[i][temp_ans_lst[i]]
            las[temp_ans_lst[i]]=0
            for j in range(26):
                temp_score-=c[j]*las[j]
        if temp_score>score:
            score=temp_score
            ans_lst=temp_ans_lst

for i in ans_lst:
    print(i+1)

Solution (Python):

from sys import stdin
from operator import itemgetter
from collections import deque, Counter
import math
import pprint
from functools import reduce
import numpy as np
import random


MOD = 1000000007
INF = float('inf')
alpha = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]

def keta(kazu): 
    kazu_str = str(kazu)
    kazu_list = [int(kazu_str[i]) for i in range(0, len(kazu_str))]
    return kazu_list

def gcd(*numbers): 
    return reduce(math.gcd, numbers)

def combination(m,n): 
    
    if n > m:
        return 'すまん'
    return math.factorial(m) // (math.factorial(m-n) * math.factorial(n))

def pow_k(x,n):  
    if n == 0:
        return 1
    K = 1
    while n > 1:
        if n % 2 != 0:
            K *= x
        x *= x
        n //= 2
    return K * x

def fact(n): 
    arr = {}
    temp = n
    for i in range(2,int(n**0.5)+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr[i] = cnt
    if temp != 1:
        arr[temp] = 1
    if arr == {}:
        arr[n] = 1
    return arr

def main():
    d = int(stdin.readline().rstrip())
    for _ in range(d):
        print(random.randint(1,26))
main()

Solution (Python):
D=int(input())
C=list(map(int,input().split()))
S=[list(map(int,input().split())) for i in range(D)]
T=[]
result=-(D*(D+1)//2)*sum(C)
last=[0 for i in range(26)]


for i in range(D):
    change=[S[i][j]+(i-last[j]+1)*(D-i)*C[j] for j in range(26)]
    t=change.index(max(change))
    print(t+1)
    T.append(t+1)
    result+=S[i][t]+(i-last[t]+1)*(D-i)*C[t]
    last[t]=i+1

Solution (Python):
import random
import time
import copy
import math
start=time.time()
d=int(input())
c=list(map(int,input().split()))
s=[]
cli=[]
for i in range(d+1):
  ch=[]
  for j in c:
    ch.append(i*j)
  cli.append(ch)
for i in range(d):
  s.append(list(map(int,input().split())))
last=[0]*26
score=0
solution=[]
for day in range(1,d+1):
  co=[]
  dla=[]
  down=0
  for (i,j) in zip(last,c):
    down+=(day-i)*j
  for (i,j) in zip(last,c):
    dla.append(down-(j*(day-i)))
  for con in range(26):
    co.append(s[day-1][con]-dla[con])
  choice=co.index(max(co))
  score+=co[choice]
  last[choice]=day
  
  
  solution.append(choice)

stemp=2750
etemp=100
def tem():
  return stemp-((stemp-etemp)*(time.time()-start)/1.9)
while time.time()-start<1.95:
  
  sc=0
  sol=copy.deepcopy(solution)
  for x in [random.randrange(d) for i in range(1)]:
    sol[x]=random.randrange(26)
  last=[0]*26
  for (day,i) in zip(range(1,d+1),sol):
    sc+=s[day-1][i]
    last[i]=day
    for (i,j) in zip(last,range(26)):
      sc-=cli[day-i][j]
  try:
    prob = math.exp((sc-score)/tem())
  except:
    prob=0
  
  if prob>random.random():
    solution=copy.deepcopy(sol)
    score=sc
    
for i in solution:
  print(i+1)

Solution (Python):
from copy import deepcopy

d=int(input())
c=list(map(int,input().split())) 
s=[] 
for i in range(d):
    t=list(map(int,input().split()))
    s.append(t)
last=[0]*26 
ans_lst=[]

for i in range(1,d): 
    temp_best=-100000000
    for j in range(26): 
        temp=s[i-1][j]
        for k in range(26): 
            if j!=k:
                temp-=(c[k]*(i-last[k]))
        temp_last=deepcopy(last)
        temp_last[j]=i
        for k in range(26):
            temp+=s[i][k]
            for l in range(26):
                if k!=l:
                    temp-=(c[l]*(i+1-temp_last[l]))
        if temp>temp_best:
            temp_best=temp
            rem=j
    ans_lst.append(rem)
    last[rem]=i
    
temp_best=-100000000 
for j in range(26): 
    temp=s[i-1][j]
    for k in range(26): 
        if j!=k:
            temp-=(c[k]*(i-last[k]))
    if temp>temp_best:
        temp_best=temp
        rem=j
ans_lst.append(rem) 

score=0
las=[0]*26
for i in range(d):
    for j in range(26):
        las[j]+=1
    score+=s[i][ans_lst[i]]
    las[ans_lst[i]]=0
    for j in range(26):
        score-=c[j]*las[j]

for q in range(1,31):
    for p in range(d-q):
        las=[0]*26
        temp_score=0
        temp_ans_lst=deepcopy(ans_lst)
        temp_ans_lst[p],temp_ans_lst[p+q]=temp_ans_lst[p+q],temp_ans_lst[p]
        for i in range(d):
            for j in range(26):
                las[j]+=1
            temp_score+=s[i][temp_ans_lst[i]]
            las[temp_ans_lst[i]]=0
            for j in range(26):
                temp_score-=c[j]*las[j]
        if temp_score>score:
            score=temp_score
            ans_lst=temp_ans_lst

for i in ans_lst:
    print(i+1)

Solution (Python):
D=int(input())
C=list(map(int,input().split()))
S=[list(map(int,input().split())) for i in range(D)]
T=[]
result=-(D*(D+1)//2)*sum(C)
last=[0 for i in range(26)]


for i in range(D):
    change=[S[i][j]+(i-last[j]+1)*(D-last[j])*C[j] for j in range(26)]
    score=max(change)
    t=change.index(score)
    T.append(t+1)
    print(t+1)
    last[t]=i+1
    result+=score