package main import ( "fmt" ) import ( "bufio" "os" "strconv" ) func main() { N := nextInt() var used = make([]bool, N) var ans = make([]int, N) for i := 0; i < N; i++ { l := nextInt() hit := false for k := 0; k < N; k++ { if k == l { continue } if !used[k] { ans[i] = k hit = true used[k] = true break } } if !hit { fmt.Println(-1) return } } for i := 0; i < N; i++ { fmt.Println(ans[i]) } } var s = bufio.NewScanner(os.Stdin) func next() string { s.Split(bufio.ScanWords) s.Scan() return s.Text() } func nextLine() string { s.Split(bufio.ScanLines) s.Scan() return s.Text() } func nextInt() int { i, e := strconv.Atoi(next()) if e != nil { panic(e) } return i } func nextLong() int64 { i, e := strconv.ParseInt(next(), 10, 64) if e != nil { panic(e) } return i }