let d = stdin.ReadLine() |> int
let c = stdin.ReadLine().Split() |> Array.map int
let s = [|1..d|] |> Array.map (fun _ -> stdin.ReadLine().Split() |> Array.map int)

let rec f i (lastli:int[]) vli =
    if i = d then vli
    else
        let arr = 
            Array.zip3 c s.[i] lastli
            |> Array.map (fun (x,y,z) -> y/x)
        let max =
            arr
            |> Array.max
        let maxi = Array.findIndex (fun x -> x=max) arr
        Array.set lastli maxi (i+1)
        Array.append vli [|maxi+1|] |> f (i+1) lastli

f 0 ([|1..26|] |> Array.map (fun _ -> 0)) [||]
|> Array.map stdout.WriteLine
|> ignore