package main import "fmt" func main() { var n int fmt.Scan(&n) a := make([]int, n) for i := 0; i < n; i++ { fmt.Scan(&a[i]) } for i := 0; i < 2*n-3; i++ { for p := 0; p < i; p++ { for q := p + 1; q < n; q++ { // log.Println(i, p, q) if p+q == i { if a[p] > a[q] { // log.Println(a[p], a[q]) a[p], a[q] = a[q], a[p] } } } } } // sort.Ints(a) for i, b := range a { fmt.Print(b) if i < len(a)-1 { fmt.Print(" ") } else if i == len(a)-1 { fmt.Print("\n") } } }