fun main(args:Array<String>?): Unit {
    val n = readLine()!!.trim().toInt()
    if (n == 1){
        println("! 1")
        return
    }
    val maxi = (2 .. n).maxBy{i ->
        println("? 1 $i")
        readLine()!!.trim().toInt()
    }!!
    val distance = (1 .. n).map{i ->
        println("? $maxi $i")
        readLine()!!.trim().toInt()
    }.withIndex().sortedBy(IndexedValue<Int>::value).map{it.index + 1}
    println("! ${distance.joinToString(" ")}")
}
