local D=io.read"*n"

local c={}
for i=1,26 do c[i]=io.read"*n"end
local s={}
for i=1,D do s[i]={}for j=1,26 do s[i][j]=io.read"*n"end end

local function copy(t)local ret={}for i,v in ipairs(t)do ret[i]=v end return ret end

local function calc(d,t,l)
	local a=0
	l[t]=d
	for j=1,26 do
		a=a-c[j]*(d-l[j])
	end
	return a+s[d][t]
end

local t={}
for i=1,D do t[i]=io.read"*n"end

local last={}
for i=1,26 do
last[i]=0
end

local ret={}
local a=0
for i=1,D do
	local lastt={}
	for j=1,26 do
		lastt[j]=copy(last)
	end
	
	local max=calc(i,1,lastt[1])
	ret[i]=1
	for j=2,26 do
		local c=calc(i,j,lastt[j])
		if(c>max)then
			max=c
			ret[i]=j
		end
	end
	last=lastt[ret[i]]
end

for i=1,D do print(ret[i])end