Buggy python submission (verdict: Time Limit Exceeded):
d = int(input())
C = list(map(int, input().split()))
S = list(list(map(int, input().split())) for _ in range(d))

out = []

def compute(task_list):
    res = 0
    last = [0] * 26
    for i in range(len(task_list)):
        last[task_list[i]] = i

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

        res += S[i][task_list[i]]   
    return res

for _ in range(d):
    score = 0
    best_type = 0
    for i in range(26):
        out.append(i)
        tmp = compute(out)

        if tmp > score:
            score = tmp
            best_type = i
        
        out.pop()
    out.append(best_type)

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


Fixed submission:
d = int(input())
c = list(map(int, input().split()))
s = list(map(int, input().split()) for _ in range(d))

import random
for i in range(d):
    print(int(random.uniform(1, 26)))

Buggy python submission (verdict: Time Limit Exceeded):
d = int(input())
C = list(map(int, input().split()))
S = list(list(map(int, input().split())) for _ in range(d))

out = []

def compute(task_list):
    res = 0
    kaisai = [0] * 26
    date = 0
    for t in task_list:
        date += 1
        kaisai[t-1] = date
        res += S[date - 1][t-1]
    
        for i in range(26):
            res -= C[i] * (date - kaisai[i])
        
    return res

for _ in range(d):
    score = 0
    best_task = 0

    for i in range(26):
        out.append(i)
        tmp = compute(out)

        if tmp > score:
            score = tmp
            best_task = i
        
        out.pop()

    out.append(best_task)

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


Fixed submission:
d = int(input())
c = list(map(int, input().split()))
s = list(map(int, input().split()) for _ in range(d))

import random
for i in range(d):
    print(int(random.uniform(1, 26)))

Buggy python submission (verdict: Time Limit Exceeded):
d = int(input())
C = list(map(int, input().split()))
S = list(list(map(int, input().split())) for _ in range(d))

def satisfication(task_list):
    res = 0
    kaisai = [0] * 26
    date = 0
    for t in task_list:
        date += 1
        kaisai[t-1] = date
        res += S[date - 1][t-1]
    
        for i in range(26):
            res -= C[i] * (date - kaisai[i])
        
    return res

task = []

for i in range(d):
    manzoku = 0
    task_tmp = 0
    for j in range(26):
        task.append(j)
        tmp = satisfication(task)
        if tmp > manzoku:
            manzoku = tmp
            task_tmp = j
        task.pop()
    task.append(task_tmp)

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


Fixed submission:
d = int(input())
c = list(map(int, input().split()))
s = list(map(int, input().split()) for _ in range(d))

import random
for i in range(d):
    print(int(random.uniform(1, 26)))

Buggy python submission (verdict: Runtime Error):
d = int(input())
C = list(map(int, input().split()))
S = list(list(map(int, input().split())) for i in range(d))
T = list(int(input()) - 1 for i in range(d))

kaisai = [0] * 26
manzoku = 0
date = 0
for t in T:
    date += 1
    kaisai[t] = date
    manzoku += S[date - 1][t]

    for i in range(26):
        manzoku -= C[i] * (date - kaisai[i])
    
    print(manzoku)


Fixed submission:
d = int(input())
c = list(map(int, input().split()))
s = list(map(int, input().split()) for _ in range(d))

import random
for i in range(d):
    print(int(random.uniform(1, 26)))