local day = io.read("*n")
local c = {}
for i = 1, 26 do
  c[i] = io.read("*n")
end
local s = {}
for id = 1, day do
  s[id] = {}
  for i = 1, 26 do
    s[id][i] = io.read("*n")
  end
end

local scores = {}
local penalties = {}
for i = 1, 26 do
  scores[i] = 0
  penalties[i] = 0
end
local ld = {}
local function solveAll(t)
  for i = 1, 26 do ld[i] = 0 end
  for id = 1, day do
    local pid = t[id]
    scores[pid] = scores[pid] + s[id][pid]
    ld[pid] = id
    for i = 1, 26 do
      penalties[i] = penalties[i] + c[i] * (id - ld[i])
    end
  end
end
local function solveDiff(t, iday, pto)
  local pfrom = t[iday]
  scores[pfrom] = scores[pfrom] - s[iday][pfrom]
  scores[pto] = scores[pto] + s[iday][pto]
  t[iday] = pto
  penalties[pfrom] = 0
  penalties[pto] = 0
  for i = 1, 26 do ld[i] = 0 end
  for id = 1, day do
    local p = t[id]
    ld[p] = id
    for ip = pfrom, pto, (pto - pfrom) do
      penalties[ip] = penalties[ip] + c[ip] * (id - ld[ip])
    end
  end
end

local function solveSum()
  local z = 0
  for i = 1, 26 do z = z + scores[i] - penalties[i] end
  return z
end

local t = {}
for id = 1, day do
  t[id] = 1 + (id % 26)
end
solveAll(t)
local score = solveSum()
math.randomseed(1)
local iter = 1
local random = math.random

local candidate = {}
for i = 1, 365 do
  candidate[i] = {}
  for j = 1, 26 do
    if 1 + (i % 26) ~= j then
      table.insert(candidate[i], j)
    end
  end
end
local day_candidate = {}
for i = 1, 365 do day_candidate[i] = i end

while os.clock() < 1.85 do
  iter = iter + 1
  if #day_candidate == 0 then
    -- reset
    for i = 1, 365 do
      day_candidate[i] = i
      candidate[i] = {}
      for j = 1, 26 do
        if t[i] ~= j then
          table.insert(candidate[i], j)
        end
      end
    end
  end
  local changeday_idx = random(1, #day_candidate)
  local changeday = day_candidate[changeday_idx]
  local changeto_idx = random(1, #candidate[changeday])
  local changeto = candidate[changeday][changeto_idx]
  table.remove(candidate[changeday], changeto_idx)
  if #candidate[changeday] == 0 then
    table.remove(day_candidate, changeday_idx)
  end
  local changefrom = t[changeday]
  -- if changefrom <= changeto then
  --   changeto = changeto + 1
  -- end
  local score_before_p1 = scores[changefrom]
  local score_before_p2 = scores[changeto]
  local penalty_before_p1 = penalties[changefrom]
  local penalty_before_p2 = penalties[changeto]
  solveDiff(t, changeday, changeto)
  local tmp = solveSum()
  if score < tmp then
    score = tmp
  else
    scores[changefrom] = score_before_p1
    scores[changeto] = score_before_p2
    penalties[changefrom] = penalty_before_p1
    penalties[changeto] = penalty_before_p2
    t[changeday] = changefrom
  end
end
-- print(iter)
print(table.concat(t, "\n"))
