### BUGGY CODE ###

#!usr/bin/env python3
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 scorei(ti, i, last, minus):
        k = [i for i in last]
        mi = minus-(i+1-last[ti])*c[ti]
        v = s[i][ti]-mi
        mi += sum_
        k[ti] = i+1
        return v, k, mi

    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
    m = 100
    sum_ = sum(c)
    q = [(0, [], [0]*n, sum_)]
    argmax = 0
    for i in range(d):
        nq = []
        for _ in range(m):
            if not q:
                break
            v, t, last, minus = heappop(q)
            for ti in range(n):
                nt = [i for i in t]
                vi,nl,nm = scorei(ti,i,last,minus)
                nv = v-vi
                nt.append(ti)
                heappush(nq,(nv,nt,nl,nm))
        q = [i for i in nq]
    t = [i+1 for i in heappop(q)[1]]
    v = score(t)
    i = 0
    while time.time() < 1.8+start:
        nt = [i for i in t]
        r = random.randrange(1,n+1)
        nt[i] = r
        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

#Solve
if __name__ == "__main__":
    solve()


### FIXED CODE ###

#!usr/bin/env python3
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 = [(i%n)+1 for i in range(d)]
    v = score(t)
    while time.time() < 1.5+start:
        nt = [None]*d
        for i in range(d):
            nti = t[i]
            r = random.random()
            if r > 0.8:
                if r > 0.9:
                    if nti < n:
                        nti += 1
                else:
                    if nti > 1:
                        nti -= 1
            nt[i] = nti
        nv = score(nt)
        if v < nv:
            t = [i for i in nt]
    for i in t:
        print(i)
    return

#Solve
if __name__ == "__main__":
    solve()