import kotlin.random.Random

fun main() {
    val d = readLine()!!.toInt()
    val c = readLine()!!.split(" ").map { it.toInt() }
    val list = (0 until d).map { readLine()!!.split(" ").map { it.toInt() } }

    fun score(examList: IntArray): Int {
        val executeDate = IntArray(d) { 0 }
        var last = 0
        return (0 until 26).map { date ->
            val exam = examList[date]
            executeDate[exam] = date

            last += list[date][exam] - (0 until 26).map { i ->
                c[i] * (date + 1 - executeDate[i])
            }.sum()

            last
        }.sum()
    }

    var result = IntArray(d) { Random.nextInt(26) }
    var score = score(result)
    repeat(50000) {
        val copy = result.clone()
        copy[Random.nextInt(d)] = Random.nextInt(26)
        val newScore = score(copy)
        if (newScore > score) {
            result = copy
            score = newScore
        }
    }


    result.forEach {
        println(it + 1)
    }
}