import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val n = sc.nextInt()
  val b = (1..n).map { sc.nextInt() }


  var array = b.toIntArray()

  var ok = true
  val list = mutableListOf<Int>()
  while (array.size != 0) {
    var tmp = 0
    for ((i, bi) in array.withIndex()) {
      if (i+1 == bi) {
        tmp = bi
      }
    }
    if (tmp > 0) {
      list.add(tmp)
      val list2 = mutableListOf<Int>()
      for (i in 0 until array.size) {
        if (i+1 == tmp) continue
        val ai = array[i]
        list2.add(ai)
      }
      array = list2.toIntArray()
      
    } else {
      ok = false
    }
    if (!ok) {
      break
    }
  }

  if (ok) {
    val tmp = list.reversed().joinToString("\n")
    println(tmp)
  } else {
    println(-1)
  }

}
