{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE TypeApplications #-}
module Main (main) where

import Control.Monad
import qualified Data.ByteString.Char8 as C8
import qualified Data.Char as C
import qualified Data.IntSet as Set
import qualified Data.List as L
import System.Random

main :: IO ()
main = do
  [d] <- readInts
  cs <- readInts
  dss <- replicateM d readInts
  -- replicateM d readInts >>= output d . solve 0
  -- let fmt s = show s ++ "\n"
  -- replicateM_ 365 $ (randomRIO @Int (1,26) >>= appendFile "tester/example/test.out" . fmt)
  replicateM_ 365 $ (randomRIO @Int (1,26) >>= print)
  -- return ()

solve :: Int -> [[Int]] -> [Int]
solve n dss
  | n < 365 = solve' n (dss !! n) : solve (n+1) dss
  | otherwise = []

solve' :: (Num a1, Ord a2, Ord a1, Enum a1) => p -> [a2] -> a1
solve' n dss = 1 + (snd $ maximum $ zip dss [0..] )

output :: Int -> [Int] -> IO ()
output d = mapM_ print

-- utils
readInts :: IO [Int]
readInts = L.unfoldr (C8.readInt . C8.dropWhile C.isSpace) <$> C8.getLine