import numpy as np
import time
import random
import collections
import bisect  
 
start = time.time()
 
def insert(list, n): 
    bisect.insort(list, n)  
    return list

def read_input():
  D = int(input())
  c = list(map(int, input().split()))
  s = [list(map(int, input().split())) for _ in range(D)]
  return D, c, s
D, c, s = read_input()
 
  
c = np.array(c)
s = np.array(s)
tests = np.argmax(s, axis=1)
# tests = [random.randrange(26) for _ in range(D)]

def get_dates_for_tests(tests):
  dates_for_tests = [list([-1]) for _ in range(26)]
  for i, t in enumerate(tests):
    dates_for_tests[t].append(i)
  for t in range(26):
    dates_for_tests[t].append(D)
  return dates_for_tests

dates_for_tests = get_dates_for_tests(tests)

def get_score(tests):
  dates_for_tests = get_dates_for_tests(tests)
  score = 0
  d = np.zeros(26, dtype=np.int64)
  for selected, S in zip(tests, s):
    d += 1
    d[selected] = 0
    score += S[selected] - (c * d).sum()
  return score

def score_diff(date, test, old_index=None, old_diff=None):
  #print(date, test)
  before = tests[date]
  if test == before:
    return 0, None, None, None, None
  pos_diff = s[date, test] - s[date, before]
  new_index = bisect.bisect_left(dates_for_tests[test], date, 1)
  new_diff = c[test] * (dates_for_tests[test][new_index] - date) * (date - dates_for_tests[test][new_index-1])

  
  old_index = bisect.bisect_left(dates_for_tests[before], date, 1) if old_index is None else old_index
  #print(c[test], dates_for_tests[test])
  #print(c[before], dates_for_tests[before])
  old_diff = c[before] * (dates_for_tests[before][old_index+1] - date) * (date - dates_for_tests[before][old_index-1]) if old_diff is None else old_diff
  
  total_diff = pos_diff + new_diff - old_diff
  #print(test, total_diff, pos_diff, new_diff, -old_diff)
  return total_diff, new_index, new_diff, old_index, old_diff


def update(date, test, old_index=None, dates_for_tests=dates_for_tests, tests=tests):
  # old_index = bisect.bisect_left(dates_for_tests[test], date, 1) if old_index is None else old_index
  # del dates_for_tests[tests[date]][old_index]
  dates_for_tests[tests[date]].remove(date)
  insert(dates_for_tests[test], date)
  tests[date] = test

debug = False

if debug:
  current_score = get_score(tests)
else:
  current_score = 0

count = 0
while time.time() < start + 1.8:
  count += 1
  # print(current_score)
  if time.time() < start + 1.4:
    for _ in range(0):
      date = random.randrange(D)
      test = random.randrange(26)
      total_diff, new_index, new_diff, old_index, old_diff = score_diff(date, test)
      current_score += total_diff
      update(random.randrange(D), random.randrange(26))
  dates = list(range(D))
  # random.shuffle(dates)
  if count % 2:
    dates.reverse()
  for date in dates:
    # if random.randrange(100) > 30:
    #   continue
  # if True:
  #   date = random.randrange(D)
    old_index, old_diff = None, None
    for test in range(26):
      # date = 4
      # test = 23
      # date = random.randrange(D)
      # test = random.randrange(26)
      total_diff, new_index, new_diff, old_index, old_diff = score_diff(date, test, old_index, old_diff)
      if total_diff > 0:
        # print('INCREASING')
        #print(date, tests[date], test)
        #print(c[[tests[date], test]])
        #print(s[date, [tests[date], test]])
        update(date, test, old_index)
        old_index = new_index
        old_diff = new_diff

        if debug:
          assert dates_for_tests == get_dates_for_tests(tests)
          new_score = get_score(tests)
          print(total_diff, new_score - current_score , current_score, new_score) 
          assert new_score == current_score + total_diff
          # current_score = new_score

        current_score += total_diff 
        # raise ValueError
        
for t in tests:
  print(t+1)

Measured memory_bytes: 27316