Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
import random

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

sumC = sum(C)
def score(strategy):
    sat = 0
    last = [0]*26
    for i,ind in enumerate(strategy):
        last = [l+1 for l in last]
        last[ind] = 0
        sat -= sum((c*l for c,l in zip(C,last)))
        sat += S[i][ind]
    return sat

#first = [np.argmax(ds) for ds in S]
first = [i % 26 for i in range(D)]

ans = first
now_score = score(ans)

for i in range(5):
    for d in range(D):
        temp = ans[:]
        temp[d] = S[d].index(max(S[d]))
        new_score = score(temp)
        if new_score > now_score:
            now_score = new_score
            ans = temp

for i in range(10):
    samples = [random.randint(0,25) for j in range(D)]
    for d in range(D):
        temp = ans[:]
        temp[d] = samples[d]
        new_score = score(temp)
        if new_score > now_score:
            now_score = new_score
            ans = temp

for i in range(3):
    for d in range(D):
        temp = ans[:]
        temp[d] = S[d].index(max(S[d]))
        new_score = score(temp)
        if new_score > now_score:
            now_score = new_score
            ans = temp

for a in ans:
    print(a+1)



Fixed submission:
import sys
import numpy as np
input = sys.stdin.readline

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

sumC = sum(C)
def score(strategy):
    sat = 0
    last = np.zeros(26).astype(np.int)
    for i,ind in enumerate(strategy):
        last += 1
        last[ind] = 0
        sat -= np.sum(C * last)
        sat += S[i][ind]
    return sat

#first = [np.argmax(ds) for ds in S]
first = [i % 26 for i in range(D)]

ans = first
now_score = score(ans)

for i in range(1):
    samples = np.random.randint(0,26,size=D).tolist()
    for d in range(D):
        temp = ans[:]
        temp[d] = samples[d]
        if score(temp) > now_score:
            ans = temp

for a in ans:
    print(a+1)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
import random

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

sumC = sum(C)
def score(strategy):
    sat = 0
    last = [0]*26
    for i,ind in enumerate(strategy):
        last = [l+1 for l in last]
        last[ind] = 0
        sat -= sum((c*l for c,l in zip(C,last)))
        sat += S[i][ind]
    return sat

#first = [np.argmax(ds) for ds in S]
first = [i % 26 for i in range(D)]

ans = first
now_score = score(ans)

for i in range(5):
    for d in range(D):
        temp = ans[:]
        temp[d] = S[d].index(max(S[d]))
        new_score = score(temp)
        if new_score > now_score:
            now_score = new_score
            ans = temp

for i in range(10):
    samples = [random.randint(0,25) for j in range(D)]
    for d in range(D):
        temp = ans[:]
        temp[d] = samples[d]
        new_score = score(temp)
        if new_score > now_score:
            now_score = new_score
            ans = temp

for i in range(5):
    for d in range(D):
        temp = ans[:]
        temp[d] = S[d].index(max(S[d]))
        new_score = score(temp)
        if new_score > now_score:
            now_score = new_score
            ans = temp

for a in ans:
    print(a+1)



Fixed submission:
import sys
import numpy as np
input = sys.stdin.readline

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

sumC = sum(C)
def score(strategy):
    sat = 0
    last = np.zeros(26).astype(np.int)
    for i,ind in enumerate(strategy):
        last += 1
        last[ind] = 0
        sat -= np.sum(C * last)
        sat += S[i][ind]
    return sat

#first = [np.argmax(ds) for ds in S]
first = [i % 26 for i in range(D)]

ans = first
now_score = score(ans)

for i in range(1):
    samples = np.random.randint(0,26,size=D).tolist()
    for d in range(D):
        temp = ans[:]
        temp[d] = samples[d]
        if score(temp) > now_score:
            ans = temp

for a in ans:
    print(a+1)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
import random

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

sumC = sum(C)
def score(strategy):
    sat = 0
    last = [0]*26
    for i,ind in enumerate(strategy):
        last = [l+1 for l in last]
        last[ind] = 0
        sat -= sum((c*l for c,l in zip(C,last)))
        sat += S[i][ind]
    return sat

#first = [np.argmax(ds) for ds in S]
first = [i % 26 for i in range(D)]

ans = first
now_score = score(ans)

for i in range(5):
    for d in range(D):
        temp = ans[:]
        temp[d] = S[d].index(max(S[d]))
        new_score = score(temp)
        if new_score > now_score:
            now_score = new_score
            ans = temp

for i in range(18):
    samples = [random.randint(0,25) for j in range(D)]
    for d in range(D):
        temp = ans[:]
        temp[d] = samples[d]
        new_score = score(temp)
        if new_score > now_score:
            now_score = new_score
            ans = temp

for i in range(3):
    for d in range(D):
        temp = ans[:]
        temp[d] = S[d].index(max(S[d]))
        new_score = score(temp)
        if new_score > now_score:
            now_score = new_score
            ans = temp

for a in ans:
    print(a+1)



Fixed submission:
import sys
import numpy as np
input = sys.stdin.readline

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

sumC = sum(C)
def score(strategy):
    sat = 0
    last = np.zeros(26).astype(np.int)
    for i,ind in enumerate(strategy):
        last += 1
        last[ind] = 0
        sat -= np.sum(C * last)
        sat += S[i][ind]
    return sat

#first = [np.argmax(ds) for ds in S]
first = [i % 26 for i in range(D)]

ans = first
now_score = score(ans)

for i in range(1):
    samples = np.random.randint(0,26,size=D).tolist()
    for d in range(D):
        temp = ans[:]
        temp[d] = samples[d]
        if score(temp) > now_score:
            ans = temp

for a in ans:
    print(a+1)