//import java.io.*

fun main() {
    val d = readInt()
    val c = readInts()
    val s = mutableListOf<List<Int>>()
    repeat(d) {
        s.add(readInts())
    }

    val last = MutableList(c.size) { 0 }

    fun calcDissatisfaction(currDay: Int): Int {
        return c.mapIndexed { index, num -> num * (currDay - last[index]) }.sum()
    }

    val contests = c.mapIndexed { index, cost -> Contest(index + 1, s[0][index], cost) }

    fun updateContests(day: Int) {
        contests.forEachIndexed { index, contest -> contest.update(day + 1, s[day - 1][index], last[index]) }
    }

    var satisfaction = 0
    var dissatisfaction: Int
    val t = mutableListOf<Int>()
    repeat(d) { day ->
        updateContests(day + 1)
        dissatisfaction = contests.map { it.dissatisfaction }.sum()
        val contestToHold = contests.maxBy { it.contribution(dissatisfaction) }!!
        last[contestToHold.id - 1] = day + 1
//        println("Dissatisfaction on day $day : ${calcDissatisfaction(day + 1)}")
        satisfaction += (s[day][contestToHold.id - 1] - calcDissatisfaction(day + 1))
        t.add(contestToHold.id)
    }

//    println("Satisfaction: $satisfaction")
//    println("Score: ${1000_000 + satisfaction}")

//    writeToFile("output.txt", t.joinToString("\n"))

//    // For submission
    println(t.joinToString("\n"))
}

data class Contest(val id: Int, var satisfaction: Int, val cost: Int) {
    var dissatisfaction = cost

    fun update(nextDay: Int, newSatisfaction: Int, lastDayHeld: Int) {
        satisfaction = newSatisfaction

        dissatisfaction = cost * (nextDay - lastDayHeld)
    }

    fun contribution(totalDissatisfaction: Int): Int {
        return satisfaction - 2*(totalDissatisfaction - dissatisfaction)
    }
}

//// Write to file
//fun writeToFile(filename: String, content: String) {
//    val outputWriter = OutputStreamWriter(FileOutputStream(File(filename)))
//    outputWriter.append(content)
//    outputWriter.close()
//}
//
//// Read from file
//private val inputReader = InputStreamReader(FileInputStream(File("input.txt")))
//private val lines = inputReader.readLines()
//private var currLine = -1
//private fun readLn(): String {
//    currLine++
//    return lines[currLine]
//}

// Current score: 62484479
// 1414762


// Input Reader
private fun readLn() = readLine()!!

private fun readStrings() = readLn().trim().split(" ")
private fun readInt() = readLn().toInt()
private fun readInts() = readStrings().map { it.toInt() }
