program main
  implicit none
  integer i,D,j,last(26),day, score(26)
  integer,allocatable :: c(:),s(:,:)
  read(*, *)D
  allocate(c(26))
  allocate(s(D,26))
  read(*, *) (c(i), i = 1,26)
  do i = 1,D
    read(*, *) (s(i,j), j = 1,26)
  end do
  last = 0
  do i = 1,D-3
    last = last + 1
    score = 0
    do j = 1,26
      score(j) = s(i,j) - 0.9*s(i+1,j) - 0.6*s(i+2,j) - 0.3*s(i+3,j) + last(j)*c(j)
    end do
    day = 1
    do j = 1,26
      if (score(j) > score(day)) then
        day = j
      end if
    end do
    write(*, *) day
    last(day) = 0
  end do
  do i = D-2,D
    last = last + 1
    score = 0
    do j = 1,26
      score(j) = s(i,j) + last(j)*c(j)
    end do
    day = 1
    do j = 1,26
      if (score(j) > score(day)) then
        day = j
      end if
    end do
    write(*, *) day
    last(day) = 0
  end do
end program main